I've written an Xtext-based plugin which works well when I open files inside one of the projects in my workspace; however, when I open a file outside the workspace (via File -> Open File...), some of the features don't work properly:
- I get syntax coloring but I don't get syntax errors.
- Quickfix options don't work, probably because
context.getXtextDocument()
returnsnull
and I rely on it for my quickfix proposals.
There might be other things I'm missing, but most other features, such as content assist, definitions-on-hover, occurrence marking etc., work fine.
Is there a way I could make workspace-external source files behave the same as internal files? Alternatively, is there a workaround which will enable me to "trick" Xtext, somehow convincing it that the file is internal to the current project, for example by programmatically creating a link to it from the project?
This is a related question about the behavior with a workspace-external file, however I succeed in opening these files just fine, it's just that some features are not working.