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

Language Service Extensions #10160

Closed
wants to merge 2 commits into from
Closed

Conversation

weswigham
Copy link
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.

@chuckjaz @ahejlsberg @mhegazy @rbuckton @vladima
This is, quite specifically, the kind of extension the @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

@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
Contributor

mhegazy commented May 22, 2017

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

@mhegazy mhegazy closed this May 22, 2017
@mhegazy mhegazy deleted the ls-extensions branch May 22, 2017 23:31
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
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.

None yet

4 participants