-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Add plugins property on TS Server open request #17151
Comments
I prefer (2) above as it is more efficient as the server is no longer involved in the file. I have no preference for the script kind name. |
Upon further reflection I believe both should be done. That is, a naive client of tsserver should be able to continue to send requests to tsserver regarding a file that tsserver reported as ignored and all subsequent requests would return no information nor produce events. |
@mjbvz is this being sent from VS Code (insiders build) today? |
No, we currently don't send this. Does the proposed design look good? Should I go ahead and add it to the insiders build? |
@RyanCavanaugh I've added this property for prototyping the change on the TS side: microsoft/vscode@c2ee613 |
@mjbvz looks good. I'll try this on a local build for prototyping |
Glad that you will work about this issue @RyanCavanaugh ! I have just one question if you implement 2)
If you have 2 plugins A and B where open is done in HTML file. Plugin A must be consumed in HTML file but not plugin B. So in this case open will not throw error, is that? |
@mjbvz I added a comment to microsoft/vscode@c2ee613 |
Probably expected since this is in the TypeScript 2.7 milestone but thought I'd mention that currently [Trace - 11:55:53 AM] Event received: telemetry (0).
Data: {
"telemetryEventName": "projectInfo",
"payload": {
// ...
"compilerOptions": {
// ...
"plugins": [
""
]
},
// ... |
Just to mention, as @mjbvz recommended me to, it's still a need for tools like Angular Language Service (see cyrilletuzi/vscode-typescript-angular-plugin#1). |
This is a blocker for proper adoption of angular-language-service together with https://github.com/theia-ide/typescript-language-server and downstream adopters like Eclipse IDE. |
@mjbvz Hello! I'm currently working on porting the Angular language service to tsserver plugin, and this issue seems to be a blocker. It has been a while since the last update, so I'm trying to catch up to the current state of tsserver plugins supporting external files. From my experimentation, it looks like the plugin is not invoked on HTML files even though it's registered for the
I think the semantic of this config means "invoke the Angular plugin when user opens a HTML file". The plugin was not invoked on HTML files regardless whether a special language is defined for Could you please provide an overview of the current state and some pointers on how I could contribute to land this feature? Note, the Angular plugin could not be loaded through I tested the Angular plugin using vsce 1.62.0, vscode 1.34.0, and typescript 3.4.5 Thank you! |
@RyanCavanaugh We should discussion what we want to do for external language support in TypeScript server. We prototyped support a while back but never committed to finalizing it and the discussions with the Angular folk sort of just faded off |
Problem
VSCode allows TSServer plugin extensions to register themselves for language modes besides javascript and typescript. The angular extension for example can register the angular TSServer plugin for the
ng-html
language. When anng-html
file is sent to TS and the angular plugin is not active, Typescript will treat the file contents as typescript code, resulting in a number of syntax errorsProposal
Add an optional
plugins
property on TSServeropen
requests.plugins
would be a list of tsserver plugin package identifiers.On the TypeScript side, the new logic for handling the
plugins
property onopen
requests would look something like:plugins
is undefined, theopen
request behaves the same as it does currently.plugins
is an array, TypeScript checks to see if any of the plugins it has loaded are in theplugins
.Open Questions
What does ignoring a file mean?
What happens when
plugins
is provided but no match is found against the loaded plugins on the TSServer? Two options I see:TS keeps the file open and VSCode continues sending update events about it, but TS never actually generate any events or fufills any requests against it.
TS tells VSCode that it doesn't care about this file, perhaps by returning an error from
open
VSCode would no longer send sync events about the file or send TS requests about itscriptKindName
OpenRequestArgs
includes an optional fieldscriptKindName?: ScriptKindName
.Should a new kind for external files be added?
The text was updated successfully, but these errors were encountered: