-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Support "external files" provided from TypeScript LS plugins #25740
Comments
My current thinking is that we add a "contributes": {
"typescriptServerPlugins": [
{
"name": "tslint-language-service",
"handles": {
"extensions": [
".html",
".ng-html"
],
"modeIds": [
"html"
]
}
}
]
}
Another version of this contributions specification where the extension defines all handled languages at the top level: "contributes": {
"typescriptServerPlugins": {
"plugins": [
{
"name": "tslint-language-service"
}
],
"handles": {
"extensions": [
".html",
".ng-html"
],
"modeIds": [
"html"
]
}
}
} @chuckjaz + @egamma Would this meet your needs? Any recommended changes or additions? |
Maybe language id's instead of extensions but otherwise looks good to me. |
|
Part of microsoft#25740 To support TS Server plugins for languages like angular, we will allow extensions to register new langauges for TypeScript to watch. The angular language for example would want ng-html files to also be uploaded to TypeScript for checking The current language definitions all define both a set of language modes they support and a set of file extensions. The file extension part is unnessiary and may be incorrect depending on how a user sets up their `file.associations` in the workspace. This change removes the extensions part so that we always make use of the language mode
…26413) Part of #25740 To support TS Server plugins for languages like angular, we will allow extensions to register new langauges for TypeScript to watch. The angular language for example would want ng-html files to also be uploaded to TypeScript for checking The current language definitions all define both a set of language modes they support and a set of file extensions. The file extension part is unnessiary and may be incorrect depending on how a user sets up their `file.associations` in the workspace. This change removes the extensions part so that we always make use of the language mode
Ok, here's an updated schema proposal: "contributes": {
"typescriptServerPlugins": [
{
"name": "tslint-language-service",
"languages": [ "html" ]
}
]
} |
I've pushed a prototype implementation of this with 4f398ba. It uses the contribute specification described above. Here's standard TS error reporting in an html file for example: This should be in the next insiders build I'll keep iterating on this on our side to improve the UX and to better handle some edge cases. Please try it out and let me know if you run into any issues |
I validated this works. I built a version of vscode from sources following the instructions in https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source synced to synced to c15e2b0. I build a version of TypeScript that includes microsoft/TypeScript#15308 rebased to 7473dcc0410f9865295daeb9bc534f7efdbcb290. I created a vscode extension that declares I verified that request from html files are directed to tsserver and that the |
Thanks @chuckjaz One big problem with the current VSCode implementation is that if an extension registers the html language, this causes TypeScript to start reporting errors and providing intellisense in every html file, not just html files that angular for example may care about. @RyanCavanaugh / @mhegazy Any thoughts on how we should handle this? Right now we just send an
Could we add a new scriptKind or argument to |
@mjbvz let's discuss tomorrow |
Tracking work for supporting non-TS files for TypeScript language service plugins
PRs this blocks:
microsoft/TypeScript#15308
https://github.com/chuckjaz/angular/tree/ts_plugin_update
/cc @chuckjaz @mjbvz
The text was updated successfully, but these errors were encountered: