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

Add "Configure Intellisense" Status Bar Item #10690

Merged
merged 35 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cce8101
change description for natvisDiagnostics
browntarik Feb 7, 2023
4f21691
Merge branch 'main' of https://github.com/Microsoft/vscode-cpptools
browntarik Feb 9, 2023
5e4d29b
Merge branch 'main' of https://github.com/Microsoft/vscode-cpptools
browntarik Feb 9, 2023
b338b8a
Merge branch 'main' of https://github.com/Microsoft/vscode-cpptools
browntarik Feb 13, 2023
063a3ad
Merge branch 'main' of https://github.com/Microsoft/vscode-cpptools
browntarik Mar 7, 2023
2241c0c
Merge branch 'main' of https://github.com/Microsoft/vscode-cpptools
browntarik Mar 14, 2023
811c0f1
Merge branch 'main' of https://github.com/Microsoft/vscode-cpptools
browntarik Mar 15, 2023
5b56d76
Add "Configure Intellisense" Status Bar Item
browntarik Mar 16, 2023
28a01c1
resolve PR
browntarik Mar 16, 2023
0917990
resolve PR
browntarik Mar 16, 2023
1ede420
resolve PR
browntarik Mar 16, 2023
5c0aac0
resolve PR
browntarik Mar 20, 2023
f62c4b1
Add sender telemtry logic
browntarik Mar 20, 2023
230bf2c
resolve PR
browntarik Mar 20, 2023
41891ea
remove test
browntarik Mar 20, 2023
a097ec1
pass sender
browntarik Mar 20, 2023
e96ffb1
resolve PR
browntarik Mar 20, 2023
b8c00d9
make lowercase
browntarik Mar 20, 2023
79a4732
replace statusBar w/ codeAction
browntarik Mar 20, 2023
97be34c
resolve PR
browntarik Mar 21, 2023
21eddf9
resolve PR
browntarik Mar 21, 2023
9a09a48
resolve PR
browntarik Mar 21, 2023
9671d44
Merge branch 'main' into browntarik/compilerWarning
browntarik Mar 21, 2023
2424918
resolve PR
browntarik Mar 22, 2023
0f140d9
Merge branch 'browntarik/compilerWarning' of https://github.com/Micro…
browntarik Mar 22, 2023
9c28a84
Merge branch 'main' into browntarik/compilerWarning
browntarik Mar 22, 2023
4ab4f34
resolve PR
browntarik Mar 22, 2023
7eaed52
resolve PR
browntarik Mar 22, 2023
b7ed495
Merge branch 'main' into browntarik/compilerWarning
browntarik Mar 22, 2023
7df0639
add lamba expression for show variable
browntarik Mar 22, 2023
d629d65
Merge branch 'browntarik/compilerWarning' of https://github.com/Micro…
browntarik Mar 22, 2023
530535c
resolve PR
browntarik Mar 22, 2023
bbf7421
remove test variable
browntarik Mar 22, 2023
a1f83b3
resolve PR
browntarik Mar 22, 2023
0a076be
Merge branch 'main' into browntarik/compilerWarning
browntarik Mar 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ export class DefaultClient implements Client {
this.showPrompt(selectCompiler, true);
action = "dismissed";
}
telemetry.logLanguageServerEvent('compilerNotification', { action }, { sender });
telemetry.logLanguageServerEvent('compilerNotification', { action, sender: util.getSenderType(sender) });
} else if (!isCommand && (compilerDefaults.compilerPath === undefined)) {
this.showPrompt(selectCompiler, false);
} else {
Expand Down Expand Up @@ -1192,7 +1192,7 @@ export class DefaultClient implements Client {
if (!compilerDefaults.trustedCompilerFound && !displayedSelectCompiler && (compilerPaths.length !== 1 || compilerPaths[0] !== "")) {
await ui.showCompilerStatusIcon(true);
// if there is no compilerPath in c_cpp_properties.json, prompt user to configure a compiler
this.promptSelectCompiler(false);
this.promptSelectCompiler(false, 'initialization');
displayedSelectCompiler = true;
}
}
Expand Down
20 changes: 9 additions & 11 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,18 +434,16 @@ function logForUIExperiment(command: string, sender?: any): void {
const properties: {[key: string]: string} = {
newUI: ui.isNewUI.toString(),
uiOverride: (settings.experimentalFeatures ?? false).toString(),
sender: getSenderType(sender)
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent(`experiment${command}`, properties);
}

function getSenderType(sender?: any): string {
if (util.isString(sender)) {
return sender;
} else if (util.isUri(sender)) {
return 'contextMenu';
}
return 'commandPalette';
function logForCompilerExperiment(command: string, sender?: any): void {
const properties: {[key: string]: string} = {
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent(`experiment${command}`, properties);
}

function onDisabledCommand(): void {
Expand Down Expand Up @@ -542,8 +540,8 @@ function onResetDatabase(): void {
}

function selectDefaultCompiler(sender?: any): void {
logForUIExperiment("CompilerSelect", sender);
clients.ActiveClient.promptSelectCompiler(true,sender);
logForCompilerExperiment("CompilerSelect", sender);
bobbrow marked this conversation as resolved.
Show resolved Hide resolved
clients.ActiveClient.promptSelectCompiler(true, sender);
}

function onSelectConfiguration(sender?: any): void {
Expand Down Expand Up @@ -691,7 +689,7 @@ async function onDisableAllTypeCodeAnalysisProblems(code: string, identifiersAnd

async function onCreateDeclarationOrDefinition(sender?: any): Promise<void> {
const properties: { [key: string]: string } = {
sender: getSenderType(sender)
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent('CreateDeclDefn', properties);
getActiveClient().handleCreateDeclarationOrDefinition();
Expand Down
9 changes: 5 additions & 4 deletions Extension/src/LanguageServer/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,14 @@ export class OldUI implements UI {
if (this.compilerTimout) {
clearTimeout(this.compilerTimout);
}
const action: string = "";
if (show) {
this.compilerTimout = setTimeout(() => { this.compilerStatusItem.show(); }, 15000);
telemetry.logLanguageServerEvent('compilerStatusBar', { 'compiler status bar shown' : action });
this.compilerTimout = setTimeout(() => {
this.compilerStatusItem.show();
telemetry.logLanguageServerEvent('compilerStatusBar');
}, 15000);
} else {
this.compilerStatusItem.hide();
telemetry.logLanguageServerEvent('compilerStatusBar', { 'compiler status bar resolved' : action });
telemetry.logLanguageServerEvent('compilerStatusBar');
browntarik marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
7 changes: 6 additions & 1 deletion Extension/src/LanguageServer/ui_new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as nls from 'vscode-nls';
import { setTimeout } from 'timers';
import { CppSettings } from './settings';
import { UI } from './ui';
import * as telemetry from '../telemetry';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
Expand Down Expand Up @@ -421,9 +422,13 @@ export class NewUI implements UI {
clearTimeout(this.compilerTimout);
}
if (show) {
this.compilerTimout = setTimeout(() => { this.compilerStatusItem.show(); }, 15000);
this.compilerTimout = setTimeout(() => {
this.compilerStatusItem.show();
browntarik marked this conversation as resolved.
Show resolved Hide resolved
telemetry.logLanguageServerEvent('compilerStatusBar');
}, 15000);
} else {
this.compilerStatusItem.hide();
telemetry.logLanguageServerEvent('compilerStatusBar');
browntarik marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
9 changes: 9 additions & 0 deletions Extension/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,15 @@ export class BlockingTask<T> {
}
}

export function getSenderType(sender?: any): string {
if (isString(sender)) {
return sender;
} else if (isUri(sender)) {
return 'contextMenu';
}
return 'commandPalette';
}

function decodeUCS16(input: string): number[] {
const output: number[] = [];
let counter: number = 0;
Expand Down