-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: resource-scoped configuration support #318
Conversation
Unit tests haven't been updated just yet, so linting and testing will not work for this PR on CI for the time being. However, end-to-end tests pass if you run them yourself, and I've manually validated functionality in a single workspace and in a multi-root workspace. |
Most impactful change to e2e test speed in the history of this extension
End-to-end tests have always been sluggish for this project. Not anymore! With the latest commit, here are the test results on my machine:
That's right — just over 20 seconds for ALL of the end-to-end tests! And with that, I'm calling it a night. Can't wait to see what it'll be like on CI once I get the unit tests working. |
End-to-end test run times on GitHub Actions:
|
I'm going to merge this now; I'm working on other tasks and it would be nice not to have conflicts when creating/modifying e2e tests and also for those tests to go by much more quickly. Happy to make changes in a patch commit/PR! |
This is a major feature. With this support, we now support multiple workspaces opened at once in VS Code, which we've never done before. Using this, we should be also able to massively speed up e2e tests.
If the client supports the
workspace/configuration
request, we use it to pull extension settings per resource (e.g. document). If it doesn't, we fall back to using a global configuration.getOptions(uri)
toLanguageServerContext
. Returns extension options specific to the given URI. If resource-scoped configuration isn't supported by the client, returns the global options regardless of URI.FormatterModule
now registers formatters per document instead of per language ID.DidRegisterDocumentFormattingEditProvider
language server notification and its corresponding extension API event now provide the URI and registration options for each registration. This is used by the formatter test to wait for the specific registration that applies to the document fixture.formattingReady
flag removed from extension API.options
removed fromLanguageServerContext
.onDidChangeValidateLanguages
language server event removed.