Skip to content

Language Service Extensions - #10160

Closed
Wesley Wigham (weswigham) wants to merge 2 commits into
extension-loadingfrom
ls-extensions
Closed

Language Service Extensions#10160
Wesley Wigham (weswigham) wants to merge 2 commits into
extension-loadingfrom
ls-extensions

Conversation

@weswigham

Copy link
Copy Markdown
Member

Split from #9038. This PR will likely need to be reopened against master once #10159 is merged, but it exists to track the progress of language service plugins.

Chuck Jazdzewski (@chuckjaz) Anders Hejlsberg (@ahejlsberg) Mohamed Hegazy (@mhegazy) Ron Buckton (@rbuckton) Vladimir Matveev (@vladima)
This is, quite specifically, the kind of extension the Angular (@angular) team has asked for. It allows for the override or filtering of most language service operations (completions, quick info, etc).

A language service provider can provide an override for the language service method of the same name. If it returns a value other than undefined, then the built-in value is not used, and the returned value is used instead (otherwise the return value of the built-in function is used). This value is then passed through any present filter methods for that function, which have the opportunity to intercept and modify the value before it is passed down the filter chain to the next extension. If a filter returns undefined, its return value is discarded and the result of the previous filter is passed forward instead.

@angelozerr

Copy link
Copy Markdown

Wesley Wigham (@weswigham) I'm very lot impatient to see your PR inside TypeSript. If I understand well, we will able to write a plugin to support for instance completion for angular controller, module inside JS file.

I tell me if you work will work too with tsserver? How to define custom plugins to load?

@mhegazy

Copy link
Copy Markdown
Contributor

closing in favor of #12231. More docs available at https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants