mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 16:58:56 +00:00
[xtext] Created example language with semantic whitespace (bug 451838)
- Added missing imports to content assist parser - Disabled emitting of synthetic end tokens for content assist parser - Added detection of overridden methods for new formatter stubs Change-Id: I989585ebc42db8ddb72514eef17ab6e47481ddcc Signed-off-by: Miro Spönemann <miro.spoenemann@itemis.de>
This commit is contained in:
parent
ba3364e0c5
commit
e2ef796cea
2 changed files with 12 additions and 3 deletions
|
@ -54,6 +54,9 @@ public interface IHiddenRegionFormatter {
|
|||
|
||||
void setOnAutowrap(IAutowrapFormatter formatter);
|
||||
|
||||
/**
|
||||
* The priority of this formatter; the default value is {@link #NORMAL_PRIORITY}.
|
||||
*/
|
||||
void setPriority(int priority);
|
||||
|
||||
void setSpace(String space);
|
||||
|
|
|
@ -50,9 +50,11 @@ public abstract class AbstractIndentationTokenSource extends AbstractSplittingTo
|
|||
@Override
|
||||
protected void doSplitToken(Token token, ITokenAcceptor result) {
|
||||
if (token.getType() == Token.EOF) {
|
||||
while(indentationStack.size() > 1) {
|
||||
indentationStack.pop();
|
||||
result.accept(createEndToken(nextOffset));
|
||||
if (shouldEmitPendingEndTokens()) {
|
||||
while(indentationStack.size() > 1) {
|
||||
indentationStack.pop();
|
||||
result.accept(createEndToken(nextOffset));
|
||||
}
|
||||
}
|
||||
result.accept(token);
|
||||
return;
|
||||
|
@ -60,6 +62,10 @@ public abstract class AbstractIndentationTokenSource extends AbstractSplittingTo
|
|||
doSplitTokenImpl(token, result);
|
||||
}
|
||||
|
||||
protected boolean shouldEmitPendingEndTokens() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Token nextToken() {
|
||||
Token result = super.nextToken();
|
||||
|
|
Loading…
Reference in a new issue