Template IntelliSense

后端 未结 2 1748
[愿得一人]
[愿得一人] 2021-02-20 11:45

I use C# mostly and one thing that I am missing in VSCode is IntelliSense in Angular 2 templates.

I found that there is a solution to this problem here, but I couldn\'t

相关标签:
2条回答
  • 2021-02-20 12:11

    That page you linked details the installation steps:

    Usage in VSCode:

    1. Replace the typescript.tmLanguage file under the install location at Contents/Resources/app/extensions/typescript/syntaxes with the version from the TypeScript-TmLanguage repo above (from the ngml branch).

    2. Fork the TypeScript repo above, checkout the ngml branch, and build.

    3. Open the VSCode global settings, and set the typescript.tsdk property to the build location in the prior step (e.g. /src/typescript/built/local).

    4. To get completions within the template on characters such as <, [, etc. open typescriptMain.ts from the Contents/Resources/app/extensions/typescript folder under the VSCode install location, and change the line that calls registerCompletionItemProvider to read vscode_1.languages.registerCompletionItemProvider(modeID, completionItemProvider, '.', '<', '(', '[', '\'');

    5. To make changes edit the local TypeScript repo, rebuild, and relaunch VSCode.

    Right now, it doesn't look like there's an extension for it, yet - likely due to gaps in the extension API which are currently in development.

    0 讨论(0)
  • 2021-02-20 12:25

    Anyone who is looking for this functionality, there is an extension Angular Language Service VS Code extension.

    0 讨论(0)
提交回复
热议问题