Vscode: Allow disabling built in extensions

Created on 12 Dec 2016  路  58Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.8.0-insider

We have requests to support disabling all TS functionality. Instead of introducing a setting we should allow disabling built in extensions.

extensions feature-request on-testplan

Most helpful comment

Disabling built-in extensions support is there now in insiders today. Please try it out.

kapture 2018-02-20 at 10 46 32

All 58 comments

@dbaeumer so I understand, would the user do something like this:

// in settings
"useBuiltInExtensions": // set to false

or would there be a setting for each built in extension?

// in settings
"useBuiltIn.TypeScriptExtension": // set to false

A concern I have is that the flow of this is so different than our other extensions. Should we consider an approach Atom took and show built in extensions in the extension viewlet? Maybe this is the approach you are suggesting.

@waderyan Would another approach be to have at least some of the built-in extensions listed in the extension pane where they could be managed using the standard extension UI?

@mjbvz I agree with your point. What you describe is what I intended to describe in this sentence:

Should we consider an approach Atom took and show built in extensions in the extension viewlet?

Comment communication failure 馃槃

@waderyan Ok, sorry I missed that. That makes the most sense to me as well. We probably don't want all of the built-in extensions listed there, but it does make sense to whitelist extensions like typescript to address specific problems

@waderyan @mjbvz I discussed that with @sandy081 and the idea was to have them listed in the extension vielwet and to allow disabling them but not to uninstall to give users a consistent experience.

For anyone else finding this thread - my current solution to disable the internal typescript is to rename tsconfig.json to tsconfig2.json, then you let npm run typsecript like so:

  "scripts": {
    "tsc": "tsc --p tsconfig2.json",

For maintainers pondering why, here's my setup

topRepoFolderOpenInVSCode/
    otherFolders/
    nodeAppFolder/
        package.json
        tsconfig.json
        src/
            myfile.ts

I wanted to install typescript only locally (not -g, so I can just npm install and be done) so I have an npm script that runs tsc. The problem is VSCode does not let you click through to typescript errors because the error output references src/myfile.ts and not nodeAppFolder/src/myfile.ts. So my tasks.json can't just use cwd to work from nodeAppFolder, instead I use npm's --prefix to run the npm script that runs tsc. The problem is that the secret internal typescript isn't following my special setup and is evaluating based on the not-root tsconfig.json creating duplicate errors which I cannot cannot click through. They even sometimes come back after they'd already been fixed, it must be confused somehow. So I'm using my own secret tsconfig2.json.

Edit - I'm still seeing phantom errors. Going to open a separate issue. Sorry to bother.

Hi there! Any updates on this thread? Can community help you with this issue?

I'm also wondering if there's any updates on this thread. :stuck_out_tongue:

Also looking for update. The default Language Mode menu (#18224) is way too long , I'd like to disable languages that I never use.

+1

As a short term solution for the Language Mode menu being too long, navigating to /resources/app/extensions/ within the application folder and renaming each extension's package.json (to something like package.json.bak) will prevent them from appearing in the menu. (The changes will be reset when updating VS Code).

Great to see discussion about this. It would be nice to have more control over VS Code by disabling that "magic like intellisense" service running in background. That is helpful to understand what is supporting and doing analysis.

Just updated my VSCode and it seems there are no more ts checks by default.

Thank you so much, guys 鉂わ笍! Great job! 馃檶 !

@Kureev Maybe this is bug :smile:
@mjbvz This is true? There are no more ts checks by default? Can you provide us more info, thanks!

@svipben it's in the changelog (1.12.1) 馃槈

@Kureev Thanks!

Well, seems I misread. But it's possible to disable it now

@Kureev How?

In the changelog it says you can use // @ts-nocheck, to opt out a file.

Not sure if it works though. I'm playing around with different configuration options, doesn't look like there are any changes in the popovers. 馃槥

@Kureev @ts-nocheckonly applies to the new semantic checking added in VSCode 1.12. @ts-check/ @ts-nocheck has no effect on syntax errors, such as using flow types in a js file:

screen shot 2017-05-05 at 3 33 59 pm

To suppress all errors in JS or TS files, set "javascript.validate.enable": false or"typescript.validate.enable": false

@mjbvz sure, I already use javascript.validate.enable: false, but it doesn't suppress these TS type messages:
image

As you can see, there are two messages about location's type: a "built in" one and one from the flow-ide. Seems that VSCode tries to assist with types, declared using TS-compatible syntax. I hoped that // @ts-nocheck can disable that, but apparently it can't (yet).

Hope there will be a way to disable them in the nearest future, will be quite handy for me.
Please, let me know if I can help with implementation.

P.S. You can find a discussion about this issue here: https://github.com/Microsoft/vscode/issues/24582

@sandy081 Any updates on this? VSCode is really annoying to write flow js code with due to all the typescript errors even though I do not use typescript. Going to switch back to atom for now :(

@kyldvs Flow in Atom (Nuclide) is not stable for me, crash a lot without any clue. Still waiting for this feature.

@kyldvs Ty setting: "javascript.validate.enable": false to disable built-in JS extension's error checking

@mjbvz Ah perfect. I had thought this disabled the flow errors too, but it seems I had a setting wrong in the flow extension. Thanks for the tip!

@gutenye Weird, it works all right for me. May be worth opening an issue on nuclide or flow project with more details about your issues.

I would like to echo @Kureev. Due to the duplicate hover type hints it's hard to justify using VS Code for Flow at all, while Nuclide provides a well supported tooling experience.

Also javascript.validate.enable: false disables all JavaScript validation, such as checking for syntax errors – not just TS related errors, such as: "'types' can only be used in a .ts file".

I would like to echo @Kureev. Due to the duplicate hover type hints it's hard to justify using VS Code for Flow at all, while Nuclide provides a well supported tooling experience.

I disagree. VSCode + Flow + prettier is much more performant than atom + nuclide + prettier. I've started using it exclusively now. This is just kind of annoying but I'm not going to stop using VSCode because of it :/

Any updates?
I also fight with TypeScript sneaking into my js projects.
Would be lovely to disable TS type checking + intellisense

+1

not sure this is the fix, but i' not getting ts errors in my project anymore

.tsconfig

{
    "compilerOptions": {
        "module": "system",
        "noImplicitAny": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "outFile": "../../built/local/tsc.js",
        "sourceMap": true
    },
    "include": [
    ],
    "exclude": [
        "**/*.js"
        "node_modules",
    ]
}

@foobar8675, it is still not working to me...

@johnunclesam i'm not sure then. this is prob not what u are looking for, but i have 2 RN projects, one using flow and one using typescript. i'm finding i'm quite happy with typescript and will probably use it on my next project over flow.

TS is using ~500M with my project, yet I do not even use TS in the source. It would be hugely appreciated if I could just disable the tsserver extension.

See https://github.com/Microsoft/vscode/issues/36105#event-1344929550

Is anyone working on a PR for this? Using flow is a pain with TypeScript sneaking everywhere.

EDIT: I made a fork without the TS built-in extension, it works great! Can't wait to see officiel support for this.

untitled

If you want to do the same (on mac), just ensure that you have all prerequisites: https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites

git clone https://github.com/Microsoft/vscode.git
cd ./vscode
npm install -g node-gyp && node-gyp configure
yarn

Replace the content of the product.json file with (to avoid broken extensions, keep the extension marketplace):

{
    "nameShort": "Code",
    "nameLong": "Code",
    "applicationName": "code",
    "dataFolderName": ".vscode",
    "win32MutexName": "vscode",
    "licenseName": "MIT",
    "licenseUrl": "https://github.com/Microsoft/vscode/blob/master/LICENSE.txt",
    "win32DirName": "Microsoft Code",
    "win32NameVersion": "Microsoft Code",
    "win32RegValueName": "Code",
    "win32AppId": "{{E34003BB-9E10-4501-8C11-BE3FAA83F23F}",
    "win32AppUserModelId": "Microsoft.Code",
    "win32ShellNameShort": "C&ode",
    "darwinBundleIdentifier": "com.visualstudio.code",
    "reportIssueUrl": "https://github.com/Microsoft/vscode/issues/new",
    "urlProtocol": "code",
    "extensionsGallery": {
        "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
        "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
        "itemUrl": "https://marketplace.visualstudio.com/items"
    }
}

BONUS: You can get replace the 2 icons in resources/darwin with the ones that can be found in an old release: https://code.visualstudio.com/updates/v1_6

rm -rf ./extensions/typescript
npx gulp vscode-darwin
open ../VSCode-darwin

Wow awesome @zoontek! Will try out this workaround soon.

A question on the cacheURL: https://vscode.blob.core.windows.net/gallery/index

It looks like it hasn't been updated since March 2017. The most recent "lastUpdated" date is 2017-03.
It there anyway to get this fixed or to get working URL?

Great work, @zoontek. Is there still no way to disable TS integration without rebuilding vscode from source?

Hey @Microsoft guys I understand you want to push the adoption of TypeScript, but please, there are people that use Flow and this situation is really getting annoying, especially since we read of people that simply compiled VSCode with a different configuration and got the desired result.

At least provide a "no-ts" version of the binaries while you work on a feature flag or any other mechanism to toggle TS in the userspace.

Pa pa pa please throw us Flow kids a bone?

Don't forget to deprecate/remove the php.suggest.basic setting as well. It was put in as a workaround for this a long time ago.

Hey @zoontek I'm trying to build on Mac but I get

$ node-gyp configure
gyp: binding.gyp not found (cwd: /Users/fezvrasta/Projects/vscode) while trying to load binding.gyp

I have all the requirements installed and XCode works properly, ideas?

@FezVrasta Although this isn't really the place for this, ignore the build instructions in the comment above; just use the build from source instructions in the wiki. Once that works you can make the edits as suggested above.

This issue pushed me back to atom. Nuclide has come a long way since the last time I鈥檝e used it. Performance is speedy now too

Disabling built-in extensions support is there now in insiders today. Please try it out.

kapture 2018-02-20 at 10 46 32

@sandy081 This is working so well so far! Thank you so much!

@sandy081 I don't have this option on my mac'os, I checked for updates and there is nothing, whats wrong?

@nickshevr Insiders build my friend. :-)

@iammerrick is it private build or I can get it?


UPD: ok, I found It https://github.com/Microsoft/vscode/issues/43361
Hope It will release soon.

@nickshevr Free for all amigo https://code.visualstudio.com/insiders/

@iammerrick thanks a lot. Today is just my second day with VS Code after 2 years with WS, and you know, I almost like it.

@iammerrick I'm sorry for mention you agian, but I couldn't fix my issue. Is there any way to turn off TS checks but still use JS checks?

I want to fix this:
image
But I dont want to turn off this:
image

  "javascript.validate.enable": false,
  "javascript.format.enable": false,

In your settings...

I tested it before Insiders build, don't like this way. As I said

I wanna still use JS checks (without ts features)

This method turns off all useful typed suggestions.

NP, I'll try another ways.

@sandy081 This is great! Thanks so much.

I'm curious if there are any plans to add the ability to disable builtins from the command line?

I have a small script that I use to synchronize my installed extensions between machines that leverages the --list-extensions, --install-extension, and --uninstall-extension APIs and it would be awesome to be able to --disable-extension (with expanded support to @builtins) to synchronize the state of my disabled extensions.

Thanks again.

Hi, I just installed the new vscode version 1.21.0 that allows you to disable builtin extensions. I disabled the TypeScript extension but I'm still having issues with the intellisense when using flow.

If I open a file from the explorer, and then from a different file I do "Go to definition" to the same file, that files opens twice.

image

image

image

If I remove // @flow then it doesn't do anything when trying to go to definition

Do I have to add any extra config?

Thanks

@dsifford Please open a feature request for your requirement

@tafelito Please open a new issue explaining the bug you are facing.

Thanks

Was this page helpful?
0 / 5 - 0 ratings