An internal error occurred during: "calculating highlighting". [message #1764893] |
Sat, 03 June 2017 00:25  |
Eclipse User |
|
|
|
Hi,
I tried to apply semantic highlighting for the following grammar rule.
definition_stream:
(ann += annotation)* DEFINE STREAM source '(' feature += Features (',' feature += Features )* ')'';'?
;
source:
inner='#'? (str_id = stream_id)
;
stream_id:
name
;
I have created a new SiddhiSemanticHighlightingCalculator class extending DefaultSemanticHighlightingCalculator class and put the followng code segment to highlight source name.
INode root = resource.getParseResult().getRootNode();
for(INode node: root.getAsTreeIterable()){
if(node.getGrammarElement()== siddhiGrammarAccess.getDefinition_streamAccess().getSourceParserRuleCall_3()){
acceptor.addPosition(node.getOffset(), node.getLength(), SiddhiHighlightingConfiguration.KEYWORD_ID);
}
//if(node.getGrammarElement()== siddhiGrammarAccess.getDefinition_functionRule())
}
super.doProvideHighlightingFor(resource, acceptor, CancelIndicator.NullImpl);
Then added the semantic highlighting class to the ui module as follows.
public Class <?extends DefaultSemanticHighlightingCalculator> bindSemanticHighlightingCOnfiguration(){
return SiddhiSemanticHighlightingCalculator.class;
}
But unfortunately when editor is opened a popup mesasge box appears and says the above mentioned error "An internal error occurred during: "calculating highlighting". java.lang.NullPointerException in xtext semantic highlighting". I had already done the custom syntax highlighting part and need some advice on this error.
Thank you very much .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06034 seconds