How to force the editor to parse the entire editor content [message #1776163] |
Mon, 13 November 2017 05:21  |
Eclipse User |
|
|
|
Hello,
I created a COBOL like syntax with Xtext. I got the syntax and an adapted lexer to handle COBOL's comment and numbering areas (column 1-6, 73-80) and the COBOL comment marker "*" on column 7. Everything is fine until I start to edit the file.
Taking the following COBOL code as an example:
* Comment
linkage section.
01 parameter PIC X(20).
procedure division using parameter.
When I start to edit e.g. the 3rd line the lexer receives only
01 parameter PIC X(20).
procedure division using parameter.
to be parsed. After that the first few columns are interpreted as comments by my lexer and the highlighting is wrong. The reduced call seems to be used only to do the styling of the text in the editor. Afterwards a check is processed on the entire document for syntax checking.
Is there a possibility to force the editor parse the entire document instead of the part beginning with the modified line?
Kind regards,
Markus
|
|
|
|
Re: How to force the editor to parse the entire editor content [message #1776224 is a reply to message #1776196] |
Tue, 14 November 2017 01:58   |
Eclipse User |
|
|
|
Thanks for the hint, but unfortunately the process does not pass PartialParsingHelper.reparse.
While editing my stack trace looks like
Thread [main] (Suspended)
DocumentTokenSource.computeDamageRegion(DocumentEvent) line: 286
DocumentTokenSource.updateStructure(DocumentEvent) line: 249
XtextDocument.fireDocumentChanged(DocumentEvent) line: 700
XtextDocument(AbstractDocument).replace(int, int, String, long) line: 1102
XtextDocument(AbstractDocument).replace(int, int, String) line: 1120
ProjectionTextStore.replace(int, int, String) line: 103
ProjectionDocument(AbstractDocument).replace(int, int, String, long) line: 1095
ProjectionDocument(AbstractDocument).replace(int, int, String) line: 1120
ProjectionDocument.replace(int, int, String) line: 625
DefaultDocumentAdapter.replaceTextRange(int, int, String) line: 233
StyledText.modifyContent(Event, boolean) line: 7355
...
The DocumentEvent holds the XtextDocument and an offset starting at the position where I type in the editor.
I think I have to override org.eclipse.xtext.ui.editor.model.DocumentTokenSource.getRepairEntryData(DocumentEvent) to achieve what I want.
Markus
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04992 seconds