microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.68k forks source link

Allow disabling built in extensions #17068

Closed dbaeumer closed 6 years ago

dbaeumer commented 7 years ago

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

waderyan commented 7 years ago

@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.

mjbvz commented 7 years ago

@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?

waderyan commented 7 years ago

@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 😄

mjbvz commented 7 years ago

@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

dbaeumer commented 7 years ago

@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.

ubershmekel commented 7 years ago

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.

Kureev commented 7 years ago

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

svipas commented 7 years ago

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

DrStrangepork commented 7 years ago

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

fimius23 commented 7 years ago

+1

mehas commented 7 years ago

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).

CBuntrock commented 7 years ago

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.

Kureev commented 7 years ago

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

Thank you so much, guys ❤️! Great job! 🙌 !

svipas commented 7 years ago

@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!

Kureev commented 7 years ago

@svipben it's in the changelog (1.12.1) 😉

svipas commented 7 years ago

@Kureev Thanks!

Kureev commented 7 years ago

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

svipas commented 7 years ago

@Kureev How?

Kureev commented 7 years ago

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. 😞

mjbvz commented 7 years ago

@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

Kureev commented 7 years ago

@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

kyldvs commented 7 years ago

@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 :(

gutenye commented 7 years ago

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

mjbvz commented 7 years ago

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

kyldvs commented 7 years ago

@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.

jacobstern commented 7 years ago

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.

Wildhoney commented 7 years ago

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".

vicapow commented 7 years ago

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 :/

krizzu commented 6 years ago

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

alcferreira commented 6 years ago

+1

matthewchung74 commented 6 years ago

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",
    ]
}
ghost commented 6 years ago

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

matthewchung74 commented 6 years ago

@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.

Panoplos commented 6 years ago

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

zoontek commented 6 years ago

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
zoontek commented 6 years ago

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
jacobstern commented 6 years ago

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

kenijo commented 6 years ago

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?

lxe commented 6 years ago

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

FezVrasta commented 6 years ago

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.

iammerrick commented 6 years ago

Pa pa pa please throw us Flow kids a bone?

mattacosta commented 6 years ago

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.

FezVrasta commented 6 years 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?

drwlrsn commented 6 years ago

@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.

shaun-sweet commented 6 years ago

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

sandy081 commented 6 years ago

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

kapture 2018-02-20 at 10 46 32

iammerrick commented 6 years ago

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

nickshevr commented 6 years ago

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

iammerrick commented 6 years ago

@nickshevr Insiders build my friend. :-)

nickshevr commented 6 years ago

@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.