Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable `Initializing JS/TS Language Features` in a specific project?

I have a Laravel project developing it inside the Visual Studio Code. Also I have the front-end with Angular 8 in a separate project which also use VSC. I build the Angular project and push the build version inside the Laravel project.

Now when I am working on my Laravel project VSC shows Initializing JS/TS Language Features message all the time inside the footer and it heavily impacts the performance of my computer.

error picture in vsc

As I am using this feature in other projects, is there a way to disable this feature just in a specific project? In this case in my Laravel project.

like image 846
MJBZA Avatar asked Jan 22 '20 12:01

MJBZA


People also ask

Does JavaScript have IntelliSense?

IntelliSense based on TypeScript declaration files For example, JavaScript IntelliSense can be provided for values declared in a . d. ts file (see TypeScript documentation), and types such as interfaces and classes declared in TypeScript are available for use as types in JsDoc comments.

How to check JavaScript version in vs code?

If you are unsure what version of TypeScript is currently active in your workspace, run the TypeScript: Select TypeScript Version command to check. You must have a .js/.ts file open in the editor to run this command. If you open a TypeScript file, the version appears in the lower right corner.

Does vscode support JavaScript?

VS Code ships with excellent support for JavaScript but you can additionally install debuggers, snippets, linters, and other JavaScript tools through extensions.


3 Answers

Disabling TypeScript and JavaScript Language Features built-in extension for a specific workplace helped to me (in my case the extension had been slowing down the performance of the machine and messing with autocomplete in React apps).

In your VSCode window:

Extensions (Ctrl + Shift + X) -> More Actions... -> Show Built-in Extensions -> Features -> TypeScript and JavaScript Language Features -> Disable (Workplace)

And reload your VSCode after that.

like image 72
mikebrsv Avatar answered Nov 12 '22 06:11

mikebrsv


TypeScript and JavaScript Language Features is a default built-in extension of VSCode. To disable it, do the following

  • Go to extensions view
    macOS: COMMAND (⌘) + SHIFT (⇧) + x
    Windows/Linux: CONTROL (⌃) + SHIFT (⇧) + x
  • Write @builtin in the search box and then search for the extension you'd want to disable, e.g. in your case TypeScript and JavaScript Language Features — now you can disable it.
  • I recommend only disabling it for your current Workspace i.e. current project

Here's a handy gif:

built in extension disable vscode

like image 44
Ahmad Awais Avatar answered Nov 12 '22 05:11

Ahmad Awais


Disabling Language Features for TS and JS will work, but you'll also lose other features (pre-compile type checking, validating, etc.). The specific problem is due to the delay in executing Code Actions and isn't directly related to TS.

Yes, disabling Language Features will solve the problem, but you can target the root cause and keep the language features active!

In the user settings you want to disable "editor.codeActionsOnSave" for any particular features that are slowing you down. In my case, it was ESLint automatically fixing code actions on save; from my settings.json:

"editor.codeActionsOnSave": {
    "source.fixAll.eslint": false
},

Disabling this let me keep language features enabled, but removed the conflict (Prettier was formatting my code on save, ESLint was fixing issues on save, and together there was a slowdown).

like image 13
msenne Avatar answered Nov 12 '22 06:11

msenne