Skip to content

Language Server Rewrite#993

Merged
TwitchBronBron merged 150 commits intomasterfrom
lsp-refactor
Feb 10, 2025
Merged

Language Server Rewrite#993
TwitchBronBron merged 150 commits intomasterfrom
lsp-refactor

Conversation

@TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Dec 21, 2023

There are some significant performance issues in the language server, focused around when files are opened/edited/closed from the editor. To mitigate this, we need to refactor the language server so that it's better about throttling/debouncing ALL the relevant files instead of just one at a time.

This is a fairly significant refactor of the language server code, and breaks it down into more manageable classes.

Task list

  • Port All the LSP functions to use the manager
  • Handle when watched files change (files not in a tab that were changed like git checkout or ropm install).
  • Handle when directories get added or deleted
  • Reload single project when bsconfig.json changes
  • Prevent revalidation when file is opened but contents haven't changed
  • Handle standalone files (files opened in a tab not included in a project)
  • Fix bugs with diagnostics being out of sync
  • Fix all the LanguageServer tests
  • Add new tests for ProjectManager and other new logic
  • Verify/manage when to pause or cancel validations
  • Clean up all unused functions in LanguageServer.ts
  • ignore changes from .roku-deploy-staging, .git, and other ignored folders
  • figure out why completions sometimes show global values instead of accurate results
  • handle logLevel across bsconfig.json files
  • handle quirks around semantic tokens (open file, find and replace all, see they didn't change)
  • fix the @trace() annotation so it doesn't log entire file contents.

Process for excluding files:

Build a global list of filters, based on:
- globs from files.exclude
- globs from .gitignore (maybe using this?)
- all files in ".git", and every workspaceFolder.outDir.
Also produce a per-project list of file globs based on the project's bsconfig (or default)

In the lsp, in onWatchedFilesChanged, filter out any files that match zero of the patterns from above (handling negated .gitignore results and files.exclude).

@TwitchBronBron TwitchBronBron changed the title Create ProjectManager Language Server Rewrite Jan 2, 2024
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 9ec6f72. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.67.8-lsp-refactor.20241018203700.tgz

* rebuildPathFilterer now retains project-specific patterns on rebuild

* Add test to verify removed project includeLists get unregistered

* Include more information in the busy tracker

* Fix lint issues
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 2aeae9b. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.67.8-lsp-refactor.20241028194456.tgz

* Fix infinite loop issue with standalone projects

* Fix failing tests

* Tweaks
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 30be955. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.67.8-lsp-refactor.20241101175856.tgz

* Cancel requests to disposed projects

* Fix broken package-lock
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 99d1548. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.67.8-lsp-refactor.20241104144219.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on c5674f5. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.67.8-lsp-refactor.20241119205608.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 9b7e0c2. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.68.0-lsp-refactor.20241125204455.tgz

* Cancel requests to disposed projects

* Fix broken package-lock

* Do not reload project if bsconfig contents are unchanged
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 3ae8b7c. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.68.0-lsp-refactor.20241125205653.tgz

…1362)

* Emit `active-runs-change` event _after_ removing it from the array.

* Remove `.only` (gotta stop doing that...)
* Prevent simultaneous validate() for same project (was causing lost diagnostics)

* Fix lint issues

* Throw exceptions in sequencer (to ensure we don't get stuck in validate forever)
…ed (#1381)

* Prevent simultaneous validate() for same project (was causing lost diagnostics)

* Fix lint issues

* Throw exceptions in sequencer (to ensure we don't get stuck in validate forever)

* Emit the `afterProgramValidate` event even when validation is cancelled
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 2ff945d. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.68.3-lsp-refactor.20250117173257.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on f8f17c6. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.68.5-lsp-refactor.20250207193531.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on c4d818f. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.68.5-lsp-refactor.20250210184022.tgz

@TwitchBronBron TwitchBronBron merged commit 5564f10 into master Feb 10, 2025
5 checks passed
@TwitchBronBron TwitchBronBron deleted the lsp-refactor branch February 10, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-package create a temporary npm package on every commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants