Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Grdowns/detect compile commands#2137

Merged
bobbrow merged 21 commits into
mastermicrosoft/vscode-cpptools:masterfrom
grdowns/detect-compile-commandsmicrosoft/vscode-cpptools:grdowns/detect-compile-commandsCopy head branch name to clipboard
Jun 19, 2018
Merged

Grdowns/detect compile commands#2137
bobbrow merged 21 commits into
mastermicrosoft/vscode-cpptools:masterfrom
grdowns/detect-compile-commandsmicrosoft/vscode-cpptools:grdowns/detect-compile-commandsCopy head branch name to clipboard

Conversation

@grdowns

@grdowns grdowns commented Jun 15, 2018

Copy link
Copy Markdown
Contributor

Respond to a compileCommandsPaths message by prompting the user to select a compile_commands.json which will then populate compileCommands in c_cpp_properties.json for the active configuration.

Comment thread Extension/src/LanguageServer/client.ts Outdated

let showCompileCommandsSelection: PersistentState<boolean> = new PersistentState<boolean>("CPP.showPromptCompileCommands", true);
if (!showCompileCommandsSelection.Value) {
return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[](start = 8, length = 3)

nit: looks like indentation is off by one space here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Comment thread Extension/src/LanguageServer/client.ts Outdated
return;
}

let message: string = "Detected compile_commands.json. Would you like to select a compile_commands.json for this configuration?";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to separate the simple case (only 1 found) from the "we need more information" case so that the user only has to click once?

If there is only one compile_commands.json found, we could just say "Would you like to use [path] to configure IntelliSense?"

Comment thread Extension/src/LanguageServer/client.ts Outdated

let message: string = "Detected compile_commands.json. Would you like to select a compile_commands.json for this configuration?";
let yes: string = "Yes";
let later: string = "Later";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Later" feels like an affirmative choice. I think you meant "Ask Me Later". In the interest of keeping labels short, "Not Now" is another alternative.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenshot
I did it to match VSCode's update message. I do agree that the alternatives you offer sound better.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the context. They are not asking a question, so "Later" is not an answer.

Comment thread Extension/src/LanguageServer/client.ts Outdated
let message: string = "Detected compile_commands.json. Would you like to select a compile_commands.json for this configuration?";
let yes: string = "Yes";
let later: string = "Later";
let dontShowAgain: string = "Don't Show Again";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Don't Ask Again" matches the context of this popup a little better

Comment thread Extension/src/LanguageServer/client.ts Outdated
return;
}

let showCompileCommandsSelection: PersistentState<boolean> = new PersistentState<boolean>("CPP.showPromptCompileCommands", true);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PersistentState is global. We might only want to disable it for the current workspace. You can use PersistentFolderState for that.

@bobbrow bobbrow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to settle the UI presentation

@WardenGnaw WardenGnaw requested review from WardenGnaw and removed request for AndrewBrianHall June 18, 2018 19:34
Comment thread Extension/src/LanguageServer/client.ts Outdated
return;
}

let message: string = "Would you like to use compile_command.json files to auto-configure IntelliSense?";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these let should be const

Comment thread Extension/src/LanguageServer/client.ts Outdated
}

let message: string = "Detected compile_commands.json. Would you like to select a compile_commands.json for this configuration?";
let message: string = "Would you like to use compile_command.json files to auto-configure IntelliSense?";

@bobbrow bobbrow Jun 18, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[sp] compile_commands.json

Comment thread Extension/src/LanguageServer/ui.ts Outdated
for (let i: number = 0; i < paths.length; i++) {
items.push({label: paths[i], description: "", index: i});
}
items.push({ label: "Edit Configurations...", description: "", index: paths.length });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see this in the spec. You should ask Rong if she wants this or not. My vote is that it's unnecessary.

Comment thread Extension/src/LanguageServer/ui.ts Outdated
items.push({ label: "Edit Configurations...", description: "", index: paths.length });

return vscode.window.showQuickPick(items, options)
.then(selection => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please indent the then block to match coding style elsewhere in the file.

Comment thread Extension/src/LanguageServer/client.ts Outdated
if (index < 0) {
return;
}
if (index >= params.paths.length) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we keep this, please add a comment that this is because "edit configurations" is added to the list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed after speaking with Rong 😄

Comment thread Extension/src/LanguageServer/client.ts Outdated
}

let compileCommandStr: string = params.paths.length > 1 ? "a compile_commands.json file" : params.paths[0];
let folderStr: string = vscode.workspace.workspaceFolders.length > 1 ? "the " + this.Name : "this";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vscode.workspace.workspaceFolders [](start = 32, length = 33)

should always check that vscode.workspace.workspaceFolders is defined before asking for .length

@bobbrow bobbrow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@bobbrow bobbrow merged commit 974ecd3 into master Jun 19, 2018
@bobbrow bobbrow deleted the grdowns/detect-compile-commands branch June 19, 2018 17:36
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.