Commit 734192ee authored by Miklos Magyari's avatar Miklos Magyari
Browse files

Improvement handling for 'deprecated' decoration


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent c5816cc2
......@@ -449,6 +449,17 @@ public abstract class Module extends Scope implements IOutlineElement, ILocateab
syntaxMap.asSynchronized().remove(offset);
}
public void removeSpecificSyntaxDecoration(int offset, SyntaxDecoration decoration) {
final IntObjectHashMap<IToken> syntaxMap = AstSyntaxHighlightTokens.getOffsetMap(identifier.getDisplayName());
if (syntaxMap == null) {
return;
}
final IToken token = tokenMap.get(decoration);
if (syntaxMap.get(offset) == token) {
syntaxMap.asSynchronized().remove(offset);
}
}
/**
* Returns the special syntax token at a given offset, if exists
* @param offset
......
......@@ -531,6 +531,8 @@ public abstract class Definition extends Assignment implements IAppendableSyntax
if (documentComment.isDeprecated()) {
getMyScope().getModuleScope().addSyntaxDecoration(getIdentifier().getLocation().getOffset(),
getIdentifier().getDisplayName(), SyntaxDecoration.Deprecated);
} else {
getMyScope().getModuleScope().removeSpecificSyntaxDecoration(getIdentifier().getLocation().getOffset(), SyntaxDecoration.Deprecated);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment