-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
RFC: Language service extensions and tests #9283
RFC: Language service extensions and tests #9283
Conversation
// prior to the host receiving it. The TypeScript language service is invoked and the | ||
// result is passed to the plugin as the value of the previous parameter. If more than one | ||
// plugin is registered, the plugins are consulted in the order they are returned from the | ||
// host. The value passed in as previous is the result returned by the prior plugin. If a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing host
with Program.getCompilerExtensions()
as my proposal had the language service host returning the extensions but this PR gets them from the program.
Thanks for taking this on! I left some minor comments. |
// be returned by the TypeScript language service. If a plugin returns a defined results | ||
// (that is, is not undefined) then that result is used instead of invoking the | ||
// corresponding TypeScript method. If multiple plugins are registered, they are | ||
// consulted in the order they are returned from the host. The first defined result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing host
with program
or Program.getCompilerExtensions()
.
5ab8d7a
to
a7ae427
Compare
@billti I'd really appreciate it if you'd take a look at this. |
69c1fd5
to
80d89fb
Compare
This has been folded into the base PR, since the API design is (relatively) stable (and merging in changes from the base to this PR was beginning to be a pain). |
Continuing from #9038.
This adds language service extensions to the extension API (additionally, extensions should start functioning in language server contexts).
Language server plugins are expected to have any of the publicly useful members of the language service (which they then override), and/or any of those names plus the string
Filter
(which they then chain together). Props to @chuckjaz for proposing the API.So a minimal language service plugin could look like this: