Skip to content

Add glint-language-server to @glint/core #44

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

Merged
merged 18 commits into from
Feb 9, 2021
Merged

Conversation

dfreeman
Copy link
Member

@dfreeman dfreeman commented Feb 7, 2021

This is based heavily on @jamescdavis's work in #40, but focuses on building common abstractions that can be shared between the language server and the CLI. Notable departures:

  • the language server sends diagnostics and serves requests for both .hbs and .ts files, which is necessary since awareness of templates can impact the behavior of scripts (e.g. renaming a symbol in the backing class should also rename its use in templates, and consuming a private field in a template should prevent it from being marked unused in the backing class)
  • the TransformManager used by the CLI is now beefed up and also consumed by the language server
  • the language server entrypoint is now strictly concerned with binding the GlintLanguageServer to specific connection events coming from the editor; data munging itself occurs elsewhere
  • a new DocumentCache layer exists that handles the inherent bound-ness between templates and their backing components while also dealing with the fact that editor contents may not align with what's on disk (this ends up being wayyyy easier to reason about than the hacks in tsserver-plugin to accomplish the same thing)

There are probably still some things that could be cleaned up or factored more sanely, but this feels like a reasonable self-contained step in a good direction. There are also no tests for the language server yet; my next goal is to begin translating some of the tsserver-plugin tests cases.

@dfreeman dfreeman added the enhancement New feature or request label Feb 7, 2021
@dfreeman dfreeman requested a review from jamescdavis February 7, 2021 15:24
@dfreeman dfreeman merged commit 200a8e8 into master Feb 9, 2021
@dfreeman dfreeman deleted the language-server branch February 9, 2021 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants