-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use didChangedWatchedFilesNotifications to trigger compilation #41
Comments
The didChangedWatchedFilesNotification does not help here because there is no notification to recognise the switch to module B in step 3. I tried it out on the branch did-changed-watched-files-notification: frege-lsp-server/src/main/java/ch/fhnw/thga/fregelanguageserver/lsp/FregeWorkspaceService.java Lines 27 to 49 in e76096e
After some thinking the problem can be solved in two ways either in step 2 or in step 3:
Step 3 provides only a solution for the active window diagnostics. If you refactor some code, then you normally want to see if it breaks anything in the whole project. This may be achievable with pull diagnostics because it also supports a relatedDocuments field. It still needs the compute all dependent classes step so we are back to solution in step 2. Besides step 3/active window diagnostics can already be triggered manually by saving the file after switching. Then there is actually also the new pull workspaceDiagnostics notification which allows to pull all workspace diagnostics. Implementation Considerations from official lsp docs:
|
Best Case Scenario
Good Case Scenario
The Good Case Scenario has only one disadvantage: It needs to read every Frege file from disk. On the other side, it has the advantage that we don't need to keep track of module dependencies in-memory. |
Currently, I trigger the compilation in the didSave notification. This leads to the following problem:
Now module B does not know anything about the changes from module A and you need to manually save the module B again to pull in the changes, which is annoying.
The text was updated successfully, but these errors were encountered: