Skip to content
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

Merged
merged 9 commits into from
Nov 8, 2021

Conversation

adalinesimonian
Copy link
Member

@adalinesimonian adalinesimonian commented Nov 7, 2021

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.

  • Added getOptions(uri) to LanguageServerContext. 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.
  • The 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 from LanguageServerContext.
  • onDidChangeValidateLanguages language server event removed.

@adalinesimonian adalinesimonian added this to the v1.2.0 milestone Nov 7, 2021
@adalinesimonian adalinesimonian self-assigned this Nov 7, 2021
@adalinesimonian adalinesimonian added this to In progress in v1.2 via automation Nov 7, 2021
@adalinesimonian
Copy link
Member Author

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.

@adalinesimonian adalinesimonian linked an issue Nov 7, 2021 that may be closed by this pull request
@adalinesimonian
Copy link
Member Author

adalinesimonian commented Nov 7, 2021

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:

Test Suites: 14 passed, 14 total
Tests:       17 passed, 17 total
Snapshots:   17 passed, 17 total
Time:        20.459 s

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.

@adalinesimonian adalinesimonian marked this pull request as ready for review November 7, 2021 17:20
@adalinesimonian adalinesimonian marked this pull request as draft November 7, 2021 17:22
@adalinesimonian
Copy link
Member Author

adalinesimonian commented Nov 8, 2021

End-to-end test run times on GitHub Actions:

@adalinesimonian adalinesimonian marked this pull request as ready for review November 8, 2021 19:37
@adalinesimonian adalinesimonian linked an issue Nov 8, 2021 that may be closed by this pull request
@adalinesimonian
Copy link
Member Author

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!

@adalinesimonian adalinesimonian merged commit e9855ee into v1.2 Nov 8, 2021
v1.2 automation moved this from In progress to Done Nov 8, 2021
@adalinesimonian adalinesimonian deleted the resource-scoped-config branch November 8, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v1.2
  
Done
Development

Successfully merging this pull request may close these issues.

Speed up e2e tests [Feature]: Scoped configuration support
1 participant