8000 Don't allow configuration providers to activate the extension when IntelliSense is disabled by bobbrow · Pull Request #2692 · microsoft/vscode-cpptools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Don't allow configuration providers to activate the extension when IntelliSense is disabled #2692

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

Merged
merged 1 commit into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
< 8000 div data-show-on-forbidden-error hidden>

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Extension/src/LanguageServer/customProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* ------------------------------------------------------------------------------------------ */
'use strict';

import { CustomConfigurationProvider, Version, SourceFileConfigurationItem, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
import * as vscode from 'vscode';
import { CustomConfigurationProvider, Version, SourceFileConfigurationItem, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
import { CppSettings } from './settings';

/**
* An interface that is guaranteed to be backward compatible with version 0
Expand Down Expand Up @@ -135,6 +136,11 @@ export class CustomConfigurationProviderCollection {
}

public add(provider: CustomConfigurationProvider, version: Version): boolean {
if (new CppSettings().intelliSenseEngine === "Disabled") {
console.warn("IntelliSense is disabled. Provider will not be registered.");
return false;
}

let wrapper: CustomProviderWrapper = new CustomProviderWrapper(provider, version);
if (!wrapper.isValid) {
this.logProblems(provider, version);
Expand Down
4 changes: 4 additions & 0 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ function onActivationEvent(): void {
}

function realActivation(): void {
if (new CppSettings().intelliSenseEngine === "Disabled") {
throw new Error("Do not activate the extension when IntelliSense is disabled.");
}

realActivationOccurred = true;
console.log("starting language server");
clients = new ClientCollection();
Expand Down
0