-
Notifications
You must be signed in to change notification settings - Fork 66
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
re-fix configuration provider initialization #1386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. @dhuebner could you test this with the grammar language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this starts feeling very convoluted. I think this change is a symptom of another problem in our language server logic. I'd like to present a different flow of data to improve on this and clean up the implementations a bit:
- Make both
initialized
methods async again - Add
ready
promises to theConfigurationProvider
andWorkspaceManager
interfaces. These are resolved as soon as the configuration is available and the workspace has been loaded (but not built!) respectively. - Await these promises at the appropriate times (i.e. for example in the
textDocument/didChange
handler) to ensure that everything actually waits for the required/expected events before continuing their work.
What is your opinion on that @sailingKieler and @spoenemann? This PR in its current implementation very much feels like a workaround for design issues in our language server, instead of an actual improvement. Especially the "switch the configuration and workspace manager initialized
calls around" smells like a badly designed system to me. That should never be the fix in a system that is well designed.
Actually, the order shouldn't matter. |
I know, and I wasn't a big fan of that either, it was just merged before I was able to complain about it :) |
Switching was not the fix, removing
That sounds good to make this logical dependency more explicit. I propose to merge this and add Mark's proposal in a follow-up PR. |
This change restores the original configuration provider initialization approach contributed in #519.
To be tested:
langium.build.ignorePatterns
during workspace init of the grammar language server (seelangium/packages/langium-vscode/src/language-server/grammar-workspace-manager.ts
Lines 33 to 38 in 1bc7009
--> Looks good AFAICS.