Skip to content

Integration Angular language-service with TypeScript's tsserver

Notifications You must be signed in to change notification settings

Quramy/ng-tsserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

It's deperecated!

With TypeScript v2.3.0 or later, you can configure Langauage Service plugins, for example:

{
  "compilerOptions": {
    
    "plugins": [
      { "name": "@angular/language-service" }
    ]
  }
}

ng-tsserver

Integrate @angular/language-service and TypeScript tsserver. It provides the following features to your editor.

  • Complete property names or custom-tags or attribute in Angular Components' template.
  • Check semantic errors in components' template.

screencast

Install

Your editor's TypeScript plugin should use tsserver because we need rewrite tsserver.js to integrate with the Angular's language service, please check out TypeScript Editor Support.

  1. Change directory your project root.
  2. Install requirements via npm install typescript @angular/language-service reflect-metadata.
  3. Execute the following script in your terminal:
curl 'https://raw.githubusercontent.com/Quramy/ng-tsserver/master/ng-tsserver' | bash

The above shell script rewrites tsserver installed locally. If you want to rewrite tsserver global installed, execute this:

curl 'https://raw.githubusercontent.com/Quramy/ng-tsserver/master/ng-tsserver' > ng-tsserver.sh
bash ng-tsserver.sh ${$(which tsserver)/bin\/tsserver/node_modules\/typescript}

Uninstall

You can recover the original tsserver.js via:

  1. cd ${YOUR_PROJECT_ROOT}/node_modules/typescript/lib
  2. cp tsserver.js.bk tsserver.js

License

MIT License

Copyright (c) 2016 Quramy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Integration Angular language-service with TypeScript's tsserver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published