Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about conflict with ms-vscode.cpptools #141

Merged
merged 10 commits into from
Jan 31, 2021
Merged

Warn about conflict with ms-vscode.cpptools #141

merged 10 commits into from
Jan 31, 2021

Conversation

kirillbobyrev
Copy link
Collaborator

vscode-clangd is known to create confusing user experience when ms-vscode.cpptools extension is enabled but it is not clear to the users. This patch creates a warning for described scenario.

@rapgenic
Copy link
Contributor

Maybe would be even more helpful to add another button saying "Disable it" that writes

    "C_Cpp.intelliSenseEngine": "Disabled",

in the config?

@kirillbobyrev
Copy link
Collaborator Author

Maybe would be even more helpful to add another button saying "Disable it" that writes

    "C_Cpp.intelliSenseEngine": "Disabled",

in the config?

Good idea! Am I correct to think this doesn't disable the whole extension altogether? I'm a bit confused by the documentation of that option: IIUC Intellisense itself is the completion provider, so this should just disable the completion source, am I correct? Would that be enough to do that in order to get around the problems we currently have with both extensions enabled?

@rapgenic
Copy link
Contributor

It should disable language server features (see microsoft/vscode-cpptools#4979), which however are completely taken over by clangd; the other features, such as debug and build keep working.

In my opinion it shoud be more than enough to avoid the compatibility issues, I myself have been using that option to keep the debug support, while using clangd for the language server features.

@kirillbobyrev
Copy link
Collaborator Author

The detection of mstools being active and the respective setting being either default or true is OK but the following doesn't work as expected:

            .then(selection => {
              console.log('selection');
              if (selection === DisableIt) {
                vscode.workspace.getConfiguration('C_Cpp').update(
                    'intelliSenseEngine', false,
                    vscode.ConfigurationTarget.Global);
              }
            })

I can't really see the global config being file being updated. And I also can't get into the function from the debugger for some reason though I'm not experienced with TS and debugging it at all.

Am I trying to update it wrong?

@kirillbobyrev
Copy link
Collaborator Author

nvm, apparently the labels & order were behaving weirdly, changing labels makes everything work fine. I removed "Got it" button since it's essentially the same as "close warning message" and only have the one which provides the needed function.

This patch works now, ready for a review.

src/extension.ts Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
@kirillbobyrev kirillbobyrev merged commit c5f6930 into clangd:master Jan 31, 2021
@kirillbobyrev kirillbobyrev deleted the ms-cpp-extension-warning branch January 31, 2021 19:54
@xpinguin
Copy link

xpinguin commented Feb 23, 2021

Hi!

Could you please suggest a way to either disable this annoying warning (along with the automatic cpptools switch off), or perhaps give me some trivial advice on the ways to edit the published extension locally?

I'm new to VSCode, using it mostly for C or C++ projects (don't like spending a lot of time configuring clangd, no incremental parsing, etc.) - my workflow with both extensions enabled was fluent and, contrary to the PR statement, quite the opposite of the word "confusing"...

Would appreciate any help, thanks in advance!

EDIT: sorry, if I've posted in the wrong place, I just want to get back to my code, so searched for a ways to somehow suppress the behaviour implemented in the current PR :( really, i'm not going to bother maintainers any much further... i'm just a fellow engineer stumbled upon the simple problem which requires too much of the situational knowledge, which unfortunately I couldn't afford to learn at the moment, neither my prior experience suggests what to do, given than bundled extensions seems to have their sources hidden from the FS layer (find -type f -name 'extension.ts' in a home dir gives me nothing).

@HighCommander4
Copy link
Contributor

@xpinguin Maybe file a new issue suggesting to add an option to disable the warning?

As for editing the extension locally, the only method I'm familiar with is to clone the repo, run npm install, make the edit, run npm run package and then install the resulting .vsix file using the vscode command "Extensions: Install from VSIX...".

@xpinguin
Copy link

xpinguin commented Feb 24, 2021

Neat! My appreciations, that solved the problem. Sure, I hope I'll create an issue when weekends would (finally!) arrive :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants