-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lsp] Don't run the generator for open files #2598
Comments
I reconsidered this and now think we should disable the generator always, because we would need two distinct builds to keep file system state separated from in-memory state. So for LSP we should bind a NEVER impl of |
i prefer at least on option to enable it |
That would mean we trigger file changes because of in-memory document changes, which is not a good idea. |
maybe moving to org.eclipse.xtext.ide.server.LanguageServerImpl.didSave(DidSaveTextDocumentParams) ? |
No, the problem is, that we only have one representation per URI and if it is opened, we will use the in-memory state, which would always be wrong for code generation. |
hmmm but if we save the represenations are equals? |
One could save one file but keep another one opened, which might be affected. |
We could say we generate only if there are no open files with changes, but that is counter intuitive for the user. |
re: introduce a command |
hmmm am not convinced if we want to replace e.g. eclipse integration with lsp4e one day for example |
am not sure if the current IncrementalBuilder is too "stupid" to handle such a case. unfortunately |
As said before, we could only generate if all files are in sync with the file system, because a just saved file could reference a dirty document that affects the code generation. |
Currently the generator is triggered for every build, even when a file is opened. The generator should be suppressed for builds triggered by
didOpen
, any also for files that are open and dirty (adidChange
has been received).The text was updated successfully, but these errors were encountered: