vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Add option to turn off language server features

Open bobbrow opened this issue 9 years ago • 14 comments

Some users of the extension may only wish to use the debugger features and don't want to be bothered with any error notifications from the language server.

moving request out of closed issue #755

bobbrow avatar May 30 '17 16:05 bobbrow

@bobbrow, actually, I really want to disable debugger feature of cpp extension. VS code should be a code editor rather than debugger. We have more professional IDE or debug tool. I wonder that why a code editor adding a debugger function. Till now, the intelliSense is not full functionality.

vscpp avatar Jun 01 '17 05:06 vscpp

The debugger feature doesn't get in the way of the editor for you, does it? There's really nothing to disable if you don't try to use it. The language server features, on the other hand, will consume CPU and memory resources by simply opening a file.

bobbrow avatar Jun 01 '17 15:06 bobbrow

@vscpp Can you explain what you mean by:

I really want to disable debugger feature of cpp extension.

What specifically do you want disabled? Like @bobbrow mentioned, unless you configure for debugging, the debug extension doesn't do any work at all.

pieandcakes avatar Jun 01 '17 19:06 pieandcakes

@bobbrow, @pieandcakes, I using VS code for C coding, searching and reading, and I debug my code by other tools. It means vs code is a source editor like Source Insight. I hope CPP extension have more function like Source Insight. But currently, seems MSFT take more effort on Debugger feature, not basic code editor improving. If you use VS code for C coding that you will find there is a big gap with Source Insight. e.g. for a data struct, if you type . or -> , there is no correct struct member display.

vscpp avatar Jun 02 '17 05:06 vscpp

@vscpp, semantic auto-complete is something I am working on currently (tracked by issue #13). We are a small team and appreciate your patience as we try to simultaneously address the incoming issues reported here.

bobbrow avatar Jun 02 '17 15:06 bobbrow

@bobbrow Thank you for creating this issue -- in the meantime, what are my options for preventing intellisense from spawning 10 threads and using 100% of the CPU power for 15 minutes every time I open a C++ project in vscode (the end result for me being a whole lots of bogus red squiggles) without disabling the debugger as well?

zajo avatar Jun 15 '17 22:06 zajo

Until this issue is addressed the way to consume the least amount of power is to use the following settings:

In settings.json:

"C_Cpp.intelliSenseEngine": "Tag Parser"

In c_cpp_properties.json

        {
            "name": "whatever",
            "includePath": [],
            "defines": [],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": "",
                "path": []
            },
            "compilerPath": ""
        }

By emptying the browse.path array, the extension should stop indexing your project folder which will effectively neutralize the language service features, however the side effect is that you will get squiggles on most, if not all, of your #include lines in your files.

bobbrow avatar Jun 15 '17 23:06 bobbrow

What I currently do is to manually patch the source. Seems to work without config file.

Go to $extension_root/out/src/main.js and comment out the following lines

LanguageServer.activate(delayedCommandsToExecute);
return LanguageServer.deactivate();

summivox avatar Dec 06 '17 23:12 summivox

+1. This would also allow users to use other C++ language servers without sacrificing the debugger.

ioeric avatar Mar 05 '18 13:03 ioeric

+1. This makes it much easier to use vscode + clangd.

yunxing avatar Mar 05 '18 16:03 yunxing

As long as multi-translation unit intellisense is not a near-future item, this should be high priority. It is very unfortunate that I have to manually go in and edit out.js again after every update is released in order to have cquery run the show and cpptools as a debugger extension only

dprandle avatar Jun 27 '18 05:06 dprandle

@dprandle The typescript code that would implement this disabling is open source, so we could accept a pull request to add some disableLanguageServer option. I understand why this is important to you and others, but the number of requests haven't been particularly high.

sean-mcmanus avatar Jun 27 '18 18:06 sean-mcmanus

+1.

YuvalFatael avatar Jul 03 '18 10:07 YuvalFatael

Fixed with 0.18.0.

sean-mcmanus avatar Aug 17 '18 13:08 sean-mcmanus