Skip to content

Commit 762de3f

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/vscode-cpptools into inactive-region-highlight
2 parents 24c4f7f + ecd1b06 commit 762de3f

17 files changed

+71
-70
lines changed

Extension/CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# C/C++ for Visual Studio Code Change Log
22

3-
## Version 0.14.6: Janurary 17, 2017
3+
## Version 0.14.6: January 17, 2018
44
* Fix tag parser failing (and continuing to fail after edits) when it shouldn't. [#1367](https://github.com/Microsoft/vscode-cpptools/issues/1367)
55
* Fix tag parser taking too long due to redundant processing. [#1288](https://github.com/Microsoft/vscode-cpptools/issues/1288)
66
* Fix debugging silently failing the 1st time if a C/C++ file isn't opened. [#1366](https://github.com/Microsoft/vscode-cpptools/issues/1366)
@@ -52,7 +52,7 @@
5252

5353
## Version 0.14.1: November 9, 2017
5454
* Add support for multi-root workspaces. [#1070](https://github.com/Microsoft/vscode-cpptools/issues/1070)
55-
* Fix files temporarly being unsavable after Save As and other scenarios on Windows. [Microsoft/vscode#27329](https://github.com/Microsoft/vscode/issues/27329)
55+
* Fix files temporarily being unsavable after Save As and other scenarios on Windows. [Microsoft/vscode#27329](https://github.com/Microsoft/vscode/issues/27329)
5656
* Fix files "permanently" being unsavable if the IntelliSense process launches during tag parsing of the file. [#1040](https://github.com/Microsoft/vscode-cpptools/issues/1040)
5757
* Show pause and resume parsing commands after clicking the database icon. [#1141](https://github.com/Microsoft/vscode-cpptools/issues/1141)
5858
* Don't show the install output unless an error occurs. [#1160](https://github.com/Microsoft/vscode-cpptools/issues/1160)
@@ -75,7 +75,7 @@
7575
* Fix `limitSymbolsToIncludedHeaders` not working with single files. [#1109](https://github.com/Microsoft/vscode-cpptools/issues/1109)
7676
* Add logging to Output window. Errors will be logged by default. Verbosity is controlled by the `"C_Cpp.loggingLevel"` setting.
7777
* Add new database status bar icon for "Indexing" or "Parsing" with progress numbers, and the previous flame icon is now just for "Updating IntelliSense".
78-
* Stop showing `(Global Scope)` if there's actually an error in identifiying the correct scope.
78+
* Stop showing `(Global Scope)` if there's actually an error in identifying the correct scope.
7979
* Fix crash with the IntelliSense process when parsing certain template code (the most frequently hit crash).
8080
* Fix main thread being blocked while searching for files to remove after changing `files.exclude`.
8181
* Fix incorrect code action include path suggestion when a folder comes after "..".
@@ -266,7 +266,7 @@
266266
* Debugging for Visual C++ applications on Windows (Program Database files) is now available.
267267
* `clang-format` is now automatically installed as a part of the extension and formats code as you type.
268268
* `clang-format` options have been moved from c_cpp_properties.json file to settings.json (File->Preferences->User settings).
269-
* `clang-format` fall-back style is now set to 'Visual Studio'.
269+
* `clang-format` fallback style is now set to 'Visual Studio'.
270270
* Attach now requires a request type of `attach` instead of `launch`.
271271
* Support for additional console logging using the keyword `logging` inside `launch.json`.
272272
* Bug fixes.
@@ -300,7 +300,7 @@
300300
* Support for debugging with GDB on Cygwin.
301301
* Debugging on 32-bit Linux now enabled.
302302
* Format code using clang-format.
303-
* Experimental fuzzy autocompletion.
303+
* Experimental fuzzy auto-completion.
304304
* Bug fixes.
305305

306306
## Version 0.5.0: April 14, 2016

Extension/src/Debugger/attachToProcess.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,34 +96,34 @@ export class RemoteAttachPicker {
9696
// Processess will follow if listed
9797
let lines: string[] = output.split(/\r?\n/);
9898

99-
if (lines.length == 0) {
99+
if (lines.length === 0) {
100100
return Promise.reject<AttachItem[]>(new Error("Pipe transport failed to get OS and processes."));
101101
} else {
102102
let remoteOS: string = lines[0].replace(/[\r\n]+/g, '');
103103

104-
if (remoteOS != "Linux" && remoteOS != "Darwin") {
104+
if (remoteOS !== "Linux" && remoteOS !== "Darwin") {
105105
return Promise.reject<AttachItem[]>(new Error(`Operating system "${remoteOS}" not supported.`));
106106
}
107107

108108
// Only got OS from uname
109-
if (lines.length == 1) {
109+
if (lines.length === 1) {
110110
return Promise.reject<AttachItem[]>(new Error("Transport attach could not obtain processes list."));
111111
} else {
112112
let processes: string[] = lines.slice(1);
113113
return PsProcessParser.ParseProcessFromPsArray(processes)
114114
.sort((a, b) => {
115-
if (a.name == undefined) {
116-
if (b.name == undefined) {
115+
if (a.name === undefined) {
116+
if (b.name === undefined) {
117117
return 0;
118118
}
119119
return 1;
120120
}
121-
if (b.name == undefined) {
121+
if (b.name === undefined) {
122122
return -1;
123123
}
124124
let aLower: string = a.name.toLowerCase();
125125
let bLower: string = b.name.toLowerCase();
126-
if (aLower == bLower) {
126+
if (aLower === bLower) {
127127
return 0;
128128
}
129129
return aLower < bLower ? -1 : 1;

Extension/src/Debugger/configurationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
8181
configurationSnippet.push(configuration.GetLaunchConfiguration());
8282
});
8383

84-
let initialConfigurations: any = configurationSnippet.filter(snippet => snippet.debuggerType == debuggerType && snippet.isInitialConfiguration)
84+
let initialConfigurations: any = configurationSnippet.filter(snippet => snippet.debuggerType === debuggerType && snippet.isInitialConfiguration)
8585
.map(snippet => JSON.parse(snippet.bodyText));
8686

8787
// If configurations is empty, then it will only have an empty configurations array in launch.json. Users can still add snippets.

Extension/src/Debugger/copyScript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function findCppToolsExtensionDebugAdapterFolder(): string {
6363
}
6464
}
6565

66-
if (dirPath == os.homedir()) {
66+
if (dirPath === os.homedir()) {
6767
console.error("Could not find installed C/C++ extension.");
6868
return null;
6969
}
@@ -81,7 +81,7 @@ function enableDevWorkflow(): Boolean {
8181
return false;
8282
}
8383

84-
return (EnableDevWorkflow || (process.env.CPPTOOLS_DEV != null));
84+
return (EnableDevWorkflow || (process.env.CPPTOOLS_DEV !== null));
8585
}
8686

8787
function copySourceDependencies(): void {

Extension/src/Debugger/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function registerAdapterExecutableCommands(): void {
7474
}));
7575

7676
disposables.push(vscode.commands.registerCommand('extension.cppvsdbgAdapterExecutableCommand', () => {
77-
if (os.platform() != 'win32') {
77+
if (os.platform() !== 'win32') {
7878
vscode.window.showErrorMessage("Debugger type 'cppvsdbg' is not avaliable for non-Windows machines.");
7979
return null;
8080
} else {

Extension/src/Debugger/nativeAttach.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ abstract class NativeAttachItemsProvider implements AttachItemsProvider {
3838
// localeCompare is significantly slower than < and > (2000 ms vs 80 ms for 10,000 elements)
3939
// We can change to localeCompare if this becomes an issue
4040
processEntries.sort((a, b) => {
41-
if (a.name == undefined) {
42-
if (b.name == undefined) {
41+
if (a.name === undefined) {
42+
if (b.name === undefined) {
4343
return 0;
4444
}
4545
return 1;
4646
}
47-
if (b.name == undefined) {
47+
if (b.name === undefined) {
4848
return -1;
4949
}
5050
let aLower: string = a.name.toLowerCase();
5151
let bLower: string = b.name.toLowerCase();
52-
if (aLower == bLower) {
52+
if (aLower === bLower) {
5353
return 0;
5454
}
5555
return aLower < bLower ? -1 : 1;

Extension/src/LanguageServer/client.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function collectSettings(filter: (key: string, val: string, settings: vscode.Wor
124124
}
125125
if (filter(key, val, settings)) {
126126
previousCppSettings[key] = val;
127-
result[key] = (key == "clang_format_path") ? "..." : String(previousCppSettings[key]);
127+
result[key] = (key === "clang_format_path") ? "..." : String(previousCppSettings[key]);
128128
if (result[key].length > maxSettingLengthForTelemetry) {
129129
result[key] = result[key].substr(0, maxSettingLengthForTelemetry) + "...";
130130
}
@@ -560,7 +560,7 @@ class DefaultClient implements Client {
560560
continue; // File already has an association.
561561
}
562562
let j: number = file.lastIndexOf('.');
563-
if (j != -1) {
563+
if (j !== -1) {
564564
let ext: string = file.substr(j);
565565
if ((("*" + ext) in assocs) || (("**/*" + ext) in assocs)) {
566566
continue; // Extension already has an association.
@@ -756,9 +756,9 @@ class DefaultClient implements Client {
756756
this.notifyWhenReady(() => {
757757
ui.showParsingCommands()
758758
.then((index: number) => {
759-
if (index == 0) {
759+
if (index === 0) {
760760
this.pauseParsing();
761-
} else if (index == 1) {
761+
} else if (index === 1) {
762762
this.resumeParsing();
763763
}
764764
});
@@ -800,11 +800,11 @@ class DefaultClient implements Client {
800800
function getLanguageServerFileName(): string {
801801
let extensionProcessName: string = 'Microsoft.VSCode.CPP.Extension';
802802
let plat: NodeJS.Platform = process.platform;
803-
if (plat == 'linux') {
803+
if (plat === 'linux') {
804804
extensionProcessName += '.linux';
805-
} else if (plat == 'darwin') {
805+
} else if (plat === 'darwin') {
806806
extensionProcessName += '.darwin';
807-
} else if (plat == 'win32') {
807+
} else if (plat === 'win32') {
808808
extensionProcessName += '.exe';
809809
} else {
810810
throw "Invalid Platform";

Extension/src/LanguageServer/configurations.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class CppProperties {
203203
if (this.configurationIncomplete && this.defaultIncludes !== undefined && this.defaultFrameworks !== undefined) {
204204
this.configurationJson.configurations[this.CurrentConfiguration].includePath = this.defaultIncludes;
205205
this.configurationJson.configurations[this.CurrentConfiguration].browse.path = this.defaultIncludes;
206-
if (process.platform == 'darwin') {
206+
if (process.platform === 'darwin') {
207207
this.configurationJson.configurations[this.CurrentConfiguration].macFrameworkPath = this.defaultFrameworks;
208208
}
209209
this.configurationIncomplete = false;
@@ -216,15 +216,15 @@ export class CppProperties {
216216
}
217217
let nodePlatform: NodeJS.Platform = process.platform;
218218
let plat: string;
219-
if (nodePlatform == 'linux') {
219+
if (nodePlatform === 'linux') {
220220
plat = "Linux";
221-
} else if (nodePlatform == 'darwin') {
221+
} else if (nodePlatform === 'darwin') {
222222
plat = "Mac";
223-
} else if (nodePlatform == 'win32') {
223+
} else if (nodePlatform === 'win32') {
224224
plat = "Win32";
225225
}
226226
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
227-
if (config.configurations[i].name == plat) {
227+
if (config.configurations[i].name === plat) {
228228
return i;
229229
}
230230
}
@@ -233,14 +233,14 @@ export class CppProperties {
233233

234234
private getIntelliSenseModeForPlatform(name: string): string {
235235
// Do the built-in configs first.
236-
if (name == "Linux" || name == "Mac") {
236+
if (name === "Linux" || name === "Mac") {
237237
return "clang-x64";
238-
} else if (name == "Win32") {
238+
} else if (name === "Win32") {
239239
return "msvc-x64";
240240
} else {
241241
// Custom configs default to the OS's preference.
242242
let nodePlatform: NodeJS.Platform = process.platform;
243-
if (nodePlatform == 'linux' || nodePlatform == 'darwin') {
243+
if (nodePlatform === 'linux' || nodePlatform === 'darwin') {
244244
return "clang-x64";
245245
}
246246
}
@@ -266,7 +266,7 @@ export class CppProperties {
266266
}
267267

268268
public select(index: number): Configuration {
269-
if (index == this.configurationJson.configurations.length) {
269+
if (index === this.configurationJson.configurations.length) {
270270
this.handleConfigurationEditCommand(vscode.window.showTextDocument);
271271
return;
272272
}
@@ -319,7 +319,7 @@ export class CppProperties {
319319
});
320320
filePaths.forEach((path: string) => {
321321
this.compileCommandFileWatchers.push(fs.watch(path, (event: string, filename: string) => {
322-
if (event != "rename") {
322+
if (event !== "rename") {
323323
this.onCompileCommandsChanged(path);
324324
}
325325
}));
@@ -389,7 +389,7 @@ export class CppProperties {
389389
private parsePropertiesFile(): void {
390390
try {
391391
let readResults: string = fs.readFileSync(this.propertiesFile.fsPath, 'utf8');
392-
if (readResults == "") {
392+
if (readResults === "") {
393393
return; // Repros randomly when the file is initially created. The parse will get called again after the file is written.
394394
}
395395

@@ -418,7 +418,7 @@ export class CppProperties {
418418
}
419419
}
420420

421-
if (this.configurationJson.version != configVersion) {
421+
if (this.configurationJson.version !== configVersion) {
422422
dirty = true;
423423
if (this.configurationJson.version === undefined) {
424424
this.updateToVersion2();
@@ -477,13 +477,13 @@ export class CppProperties {
477477
let propertiesFile: string = path.join(this.configFolder, "c_cpp_properties.json");
478478
fs.stat(propertiesFile, (err, stats) => {
479479
if (err) {
480-
if (this.propertiesFile != null) {
480+
if (this.propertiesFile !== null) {
481481
this.propertiesFile = null; // File deleted.
482482
this.resetToDefaultSettings(true);
483483
this.handleConfigurationChange();
484484
}
485485
} else if (stats.mtime > this.configFileWatcherFallbackTime) {
486-
if (this.propertiesFile == null) {
486+
if (this.propertiesFile === null) {
487487
this.propertiesFile = vscode.Uri.file(propertiesFile); // File created.
488488
}
489489
this.handleConfigurationChange();

Extension/src/LanguageServer/extension.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function activate(activationEventOccurred: boolean): void {
8181
if (vscode.workspace.textDocuments !== undefined && vscode.workspace.textDocuments.length > 0) {
8282
for (let i: number = 0; i < vscode.workspace.textDocuments.length; ++i) {
8383
let document: vscode.TextDocument = vscode.workspace.textDocuments[i];
84-
if (document.languageId == "cpp" || document.languageId == "c") {
84+
if (document.languageId === "cpp" || document.languageId === "c") {
8585
return onActivationEvent();
8686
}
8787
}
@@ -95,7 +95,7 @@ function onDidOpenTextDocument(document: vscode.TextDocument): void {
9595
}
9696

9797
function onActivationEvent(): void {
98-
if (tempCommands.length == 0) {
98+
if (tempCommands.length === 0) {
9999
return;
100100
}
101101

@@ -163,7 +163,7 @@ function onDidChangeActiveTextEditor(editor: vscode.TextEditor): void {
163163
}
164164

165165
let activeEditor: vscode.TextEditor = vscode.window.activeTextEditor;
166-
if (!activeEditor || (activeEditor.document.languageId != "cpp" && activeEditor.document.languageId != "c")) {
166+
if (!activeEditor || (activeEditor.document.languageId !== "cpp" && activeEditor.document.languageId !== "c")) {
167167
activeDocument = "";
168168
} else {
169169
activeDocument = editor.document.uri.toString();
@@ -180,7 +180,7 @@ function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeE
180180
return;
181181
}
182182

183-
if (activeDocument != event.textEditor.document.uri.toString()) {
183+
if (activeDocument !== event.textEditor.document.uri.toString()) {
184184
// For some strange (buggy?) reason we don't reliably get onDidChangeActiveTextEditor callbacks.
185185
activeDocument = event.textEditor.document.uri.toString();
186186
clients.activeDocumentChanged(event.textEditor.document);
@@ -245,7 +245,7 @@ function onSwitchHeaderSource(): void {
245245
return;
246246
}
247247

248-
if (activeEditor.document.languageId != "cpp" && activeEditor.document.languageId != "c") {
248+
if (activeEditor.document.languageId !== "cpp" && activeEditor.document.languageId !== "c") {
249249
return;
250250
}
251251

@@ -379,7 +379,7 @@ function onTakeSurvey(): void {
379379
}
380380

381381
function reportMacCrashes(): void {
382-
if (process.platform == "darwin") {
382+
if (process.platform === "darwin") {
383383
prevCrashFile = "";
384384
let crashFolder: string = path.resolve(process.env.HOME, "Library/Logs/DiagnosticReports");
385385
fs.stat(crashFolder, (err, stats) => {

Extension/src/LanguageServer/ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class UI {
187187

188188
let items: IndexableQuickPickItem[];
189189
items = [];
190-
if (this.browseEngineStatusBarItem.tooltip == "Parsing paused") {
190+
if (this.browseEngineStatusBarItem.tooltip === "Parsing paused") {
191191
items.push({ label: "Resume Parsing", description: "", index: 1 });
192192
} else {
193193
items.push({ label: "Pause Parsing", description: "", index: 0 });

0 commit comments

Comments
 (0)