-
Notifications
You must be signed in to change notification settings - Fork 122
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
Angular LS as tsserver plugin #338
Comments
That other plugin that did it... can you learn some lessons from it to speed up dev? https://github.com/cyrilletuzi/vscode-typescript-angular-plugin |
@jpike88 the other plugin only did it for inline templates and not for external |
@kyliau I have managed to activate angular typescipt plugin in vscode. I did changes in vscode and angular language service. I also have to add this this setting to settings.json: |
@andrius-pra thanks for the suggestion! I'll try it out. What about non-Angular html files? Did you see any errors on those? |
Typescript do types checking only for project root files. So by default it doesn't show any error for html files. I use non public api to add html files to project root here. |
@andrius-pra I agree with the modification to filter out diagnostics for HTML files in Angular, but I don't think the hack to add missing file root is needed, because that's the whole point of declaring "languages" in "typescriptServerPlugins", isn't it? |
@kyliau , we don't need this hack. I'm able to get diagnostic errors with changes in typescript, vscode and angular. |
Do we have an ETA on this? |
@SteffenKoehler this plugin https://github.com/cyrilletuzi/vscode-typescript-angular-plugin That doesn't even work with inline templates. But I'm using it instead because it is far more performant. This official one is sluggish and sometimes hovering over a definition takes ages for it to show the popover. |
@kyliau God things are moving so sluggishly on this project. Typically I'd throw money at it to help move it along, but this is a Google in-house project. Considering how widespread VSCode is used, and how integral TS is to Angular, why isn't this getting more activity? Shouldn't there be at least 2 employees assigned to this?? |
@kyliau Have you considered contributing patches instead of complaining? That's how OSS works: people providing code get the influence, if you want more influence, provide more code. Or maybe buy and run Google Inc. to make sure you'll be free to assign as much of its staff you want on the project. |
I contribute to enough OSS projects as it is without needing to be talked down to like that. You're contributing even less than I am by assuming that every person giving things a poke is some kind of freeloader. |
There are different way of |
Don't you have better things to do than trying to police how other people communicate? My question was addressed to the project maintainers, so why don't you mind your own business? |
After much deliberation and discussion with the TypeScript team, we've decided that the Angular language service will not be purely a tsserver plugin. This means:
This does not mean:
The main reasons for this are:
Going forward, #335 will be used to track the progress of remaining work items for the language service. If you run into specific plugin problems, please open a new issue, thank you! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Here's my attempt at trying to document what I've learned about tsserver plugin so far:
The main benefit of a tsserver plugin is performance.
tsserver
and the plugin both share the same Typescript instance, so there's no duplicate parsing/compilation. It also addresses the issue with version mismatch.However, Angular LS has a slightly different requirement, since the plugin would have to handle external (non TS) files as well. These are typically
.html
files defined viatemplateUrl
in the Angular component.There are two ways to enable a plugin:
Issue: this only works for Typescript files.
Here we could associate the plugin with a list of
languages
, see below.Once the plugin is loaded, there are two ways to define external files:
The plugin itself returns a list of external files through
getExternalFiles()
.This is implemented in Allow plugins to provide a list of external files. microsoft/TypeScript#15308, but seems to be less preferable compared to the second approach below.
Associate plugin with a set of languages.
Whenever a file that matches the language is opened, the plugin will be notified.
Issues
As of vscode 1.34.0 and typescript 3.4.5, registering the plugin with languages seems to have no effect. The plugin simply isn't notified about the external files.
Assume (1) above is resolved, the plugin needs to make sure HTML are not parsed as TS files.
HTML files should not be parsed as TS when the plugin is not present.
What if .html is open but none of the TS file are?
Syntax highlighting missing after fixing (2).
Related
"Add plugins property on TS Server open request"
Add plugins property on TS Server open request microsoft/TypeScript#17151
"Languages provided by plugins not synced"
typescript: languages provided by plugins not synced microsoft/vscode#75088
The text was updated successfully, but these errors were encountered: