Add glint-language-server
to @glint/core
#44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
.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)TransformManager
used by the CLI is now beefed up and also consumed by the language serverGlintLanguageServer
to specific connection events coming from the editor; data munging itself occurs elsewhereDocumentCache
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 intsserver-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.