Code Actions on Save
The editor.codeActionsOnSave establishing enables you to configure a collection of Code Actions which are run whenever a file is conserved. As an example, you can allow arrange imports on save by establishing:
You may set editor.codeActionsOnSave to a range of Code Actions to perform to be able.
Below are a few supply actions:
- “organizeImports” – Enables organize imports on salvage.
- “fixAll” – Auto Fix on Save computes all feasible repairs in one single round (for many providers including ESLint).
- “fixAll.eslint” – car Fix just for ESLint.
- “addMissingImports” – Adds all imports that are missing salvage.
See TypeScript to find out more.
Code recommendations
VS Code immediately shows some code that is common such as for instance converting a string of .then Calls on a promise to use await and async
Sorry, your web web browser does not help HTML 5 video clip.
Set “typescript.suggestionActions.enabled” to false to disable recommendations.
Sources CodeLens
The references that are typeScript shows an inline count of guide for classes, interfaces, techniques, properties, and exported items:
It is possible to enable this by establishing “typescript.referencesCodeLens.enabled”: real into the User Settings file.
Click the guide count to browse a list quickly of sources:
Implementations CodeLens
The implementations that are typeScript shows the amount of implementors of an software:
You can easily allow this by settin: real .
Just like the sources CodeLens, it is possible to click the execution count to quickly browse an inventory of most implementations.
Update imports on file move
Whenever you move or rename a file that is brought in by other files in your TypeScript task, VS Code can immediately upgrade all import paths that reference the moved file. Continuar lendo TypeScript in Artistic Studio Code. Setting up the TypeScript compiler