Compare commits

...
Author SHA1 Message Date
Sean McManus 08776b77f7 Merge pull request #9557 from microsoft/seanmcm/revertDeplaySteps
revert deploy steps
2022-07-07 18:55:50 -07:00
Sean McManus b34766054b Remove changelog entry. 2022-07-07 18:48:05 -07:00
Sean McManus 8914e28c26 Revert "Add deploySteps and variables to cppdbg (#9418)"
This reverts commit b55a98c697.
2022-07-07 18:46:31 -07:00
Sean McManus 2a39dc402a Merge pull request #9550 from microsoft/main
Merge for 1.11.1
2022-07-07 15:55:09 -07:00
xisui-MSFT b55a98c697 Add deploySteps and variables to cppdbg (#9418)
* Add deploySteps and variables to cppdbg
2022-07-06 19:55:39 -07:00
Sean McManus 08b9c995bd Update changelog for 1.11.1 (#9549) 2022-07-06 17:56:43 -07:00
Colen Garoutte-Carson 6da34e4236 Display a log message when intelliSenseMode is Disabled (#9543) 2022-07-06 17:50:34 -07:00
Sean McManus e172440607 Fix cl.exe being excluded for .c files and c/cpp caching. (#9544)
* Fix cl.exe being excluded for .c files and c/cpp caching.
2022-07-06 15:23:30 -07:00
Sean McManus 2a5198ed9d Merge pull request #9477 from microsoft/main
Change inlayHint defaults settings. (#9476)
2022-06-20 11:42:18 -07:00
Sean McManus 3d7f5ea0ca Merge pull request #9470 from microsoft/main
Show or hide commands based on C_Cpp.intelliSenseEngine value (#9469)
2022-06-17 16:46:44 -07:00
Sean McManus 3abe8a564b Merge pull request #9468 from microsoft/main
Merge for 1.11.0
2022-06-17 14:03:31 -07:00
Colen Garoutte-Carson 4fc18a7eb4 Merge pull request #9400 from microsoft/main 2022-06-03 14:48:59 -07:00
Sean McManus c3dd4405a6 Merge pull request #9344 from microsoft/main
Merge for 1.10.3
2022-05-20 17:07:19 -07:00
Sean McManus 32ba555dee Merge pull request #9304 from microsoft/main
Update changelog and version. (#9303)
2022-05-12 17:08:36 -07:00
Michelle Matias f31caa30f4 Merge pull request #9290 from microsoft/main
1.10.1 insiders
2022-05-09 17:52:14 -07:00
Colen Garoutte-Carson fab35332eb Merge pull request #9213 from microsoft/main 2022-04-20 16:52:16 -07:00
Sean McManus 8bea1ecb35 Merge pull request #9061 from microsoft/main
Merge for 1.9.6
2022-03-21 11:48:55 -07:00
Sean McManus caecbf9532 Merge pull request #9045 from microsoft/main
Merge for 1.9.5
2022-03-17 12:42:42 -07:00
Sean McManus c3312d3fba Merge pull request #9030 from microsoft/main
Merge for 1.9.4
2022-03-15 21:46:09 -07:00
Sean McManus 7886ac0e98 Merge pull request #9002 from microsoft/main
Merge for 1.9.3
2022-03-09 13:49:43 -08:00
Sean McManus 8eea7fb23e Merge pull request #8957 from microsoft/main
Merge for 1.9.2
2022-03-01 14:02:57 -08:00
elrashed ec511b941d Merge branch 'main' into insiders 2022-02-24 11:50:54 -08:00
Colen Garoutte-Carson 17140a9fde Merge pull request #8923 from microsoft/main 2022-02-23 19:23:56 -08:00
Michelle Matias b30c098dc1 Merge pull request #8839 from microsoft/main
Insiders 1.9.0 #3
2022-02-10 15:59:16 -08:00
Michelle Matias e135b011bc Merge pull request #8833 from microsoft/mimatias/insiders1-9
Insiders 1.9.0 #2
2022-02-10 13:38:38 -08:00
Michelle Matias 2913721755 Merge branch 'main' into mimatias/insiders1-9 2022-02-10 13:30:18 -08:00
Michelle Matias 7a83d8d76a Merge pull request #8831 from microsoft/mimatias/insiders1_9
Insiders 1.9.0
2022-02-10 13:20:21 -08:00
Michelle Matias db67ca332c remove extra === 2022-02-10 13:17:26 -08:00
Michelle Matias 69cf11512a Merge branch 'main' into mimatias/insiders1_9 2022-02-10 13:11:50 -08:00
Colen Garoutte-Carson 011b5c12a9 Merge pull request #8783 from microsoft/coleng/merge_insiders_1_8_4 2022-02-04 17:14:12 -08:00
Colen Garoutte-Carson b5c13664a6 Update changelog for 1.8.4 (#8778) 2022-02-04 16:37:54 -08:00
Sean McManus f95b1cebf7 Remove offline installation from ReadMes. (#8769) 2022-02-04 16:37:50 -08:00
Colen Garoutte-Carson 4813194480 Suppress incorrect warnings on Mac M1 (#8757) 2022-02-04 16:37:45 -08:00
Sean McManus 97fd5b6bb9 Update changelog. (#8754)
* Update changelog.
2022-02-04 16:37:38 -08:00
Sean McManus 75d131d3ea Merge pull request #8747 from microsoft/main
Merge for 1.8.3 (insiders)
2022-01-31 12:28:29 -08:00
Sean McManus abc3c11cab Merge pull request #8731 from microsoft/main
Merge for 1.8.1
2022-01-27 13:46:46 -08:00
Colen Garoutte-Carson 88f0bbebb9 Merge pull request #8669 from microsoft/main 2022-01-13 13:39:55 -08:00
Colen Garoutte-Carson 7b175d4ab4 Merge pull request #8663 from microsoft/main 2022-01-12 13:48:16 -08:00
Colen Garoutte-Carson 29e8ff6f3b Merge pull request #8658 from microsoft/main 2022-01-11 18:10:18 -08:00
Colen Garoutte-Carson d0985f5c82 Merge main into insiders branch (#8656) 2022-01-11 16:28:17 -08:00
Sean McManus 7f996068d4 Merge pull request #8503 from microsoft/main
Merge for 1.8.0-insiders2
2021-12-07 13:40:33 -08:00
Sean McManus 27d1ac3897 Merge pull request #8463 from microsoft/main
Merge for 1.8.0-insiders
2021-11-29 17:06:40 -08:00
Colen Garoutte-Carson 999f28bf83 Merge pull request #8205 from microsoft/main 2021-09-29 16:28:41 -07:00
Colen Garoutte-Carson f7d0b1bf22 Merge pull request #8187 from microsoft/main 2021-09-24 14:13:41 -07:00
Colen Garoutte-Carson eede66558e Merge pull request #8007 from microsoft/main 2021-08-18 16:00:20 -07:00
Colen Garoutte-Carson a9890f62ae Merge pull request #7988 from microsoft/main 2021-08-16 18:26:31 -07:00
Colen Garoutte-Carson c98303bd2c Merge pull request #7967 from microsoft/main 2021-08-12 13:20:55 -07:00
Colen Garoutte-Carson c658673abb Merge pull request #7963 from microsoft/main
Merge main to insiders branch
2021-08-11 18:52:59 -07:00
Sean McManus 7ad30dae85 Merge pull request #7766 from microsoft/main
Merge for 1.5.0-insiders3 (2nd time)
2021-07-01 14:25:47 -07:00
Sean McManus 2ab63a451a Merge pull request #7758 from microsoft/main
Merge for 1.5.0-insiders3
2021-06-30 17:46:54 -07:00
Sean McManus 857bce91ee Merge pull request #7734 from microsoft/main
Merge for 1.5.0-insiders2
2021-06-21 15:49:31 -07:00
Sean McManus 49b8160a58 Merge pull request #7695 from microsoft/main
Fix settings UI. (#7694)
2021-06-14 15:21:58 -07:00
Sean McManus 4d80ef39cb Merge pull request #7691 from microsoft/main
Minor changes. (#7690)
2021-06-14 11:31:53 -07:00
Sean McManus 8ea76a7d8b Merge pull request #7683 from microsoft/1_5_0_insiders
1 5 0 insiders
2021-06-11 19:36:17 -07:00
Sean McManus 046821112b Merge branch 'main' into 1_5_0_insiders 2021-06-11 17:47:43 -07:00
Sean McManus 18ac98a353 Merge pull request #7591 from microsoft/seanmcm/1_4_0_insiders3_2
1.4.0-insiders3 2nd time
2021-05-25 15:27:47 -07:00
Sean McManus fad828ed78 Merge branch 'main' into seanmcm/1_4_0_insiders3_2 2021-05-25 14:37:44 -07:00
Sean McManus f675d7ece3 Merge pull request #7566 from microsoft/seanmcm/1_4_0_insiders3
1.4.0-insiders3
2021-05-20 18:44:01 -07:00
Sean McManus 213799975c Merge branch 'main' into seanmcm/1_4_0_insiders3 2021-05-20 18:39:44 -07:00
Sean McManus 3512a088d6 Merge pull request #7537 from microsoft/seanmmc/1_4_0_insiders2
1.4.0-insiders2
2021-05-17 14:09:30 -07:00
Sean McManus 8ec3dfa3fd Merge branch 'main' into seanmmc/1_4_0_insiders2 2021-05-17 12:58:47 -07:00
Sean McManus 905f8dc216 Merge pull request #7504 from microsoft/seanmcm/1_4_0_insidersMerge2
1.4.0-insiders merge2
2021-05-10 11:55:49 -07:00
Sean McManus 6464f55fcf Merge branch 'main' into seanmcm/1_4_0_insidersMerge2 2021-05-10 09:54:57 -07:00
Sean McManus dba4a28d88 Merge pull request #7480 from microsoft/seanmcm/1_4_0_insiders
1.4.0-insiders
2021-05-06 19:39:23 -07:00
Sean McManus 53a3864fdc Update version. 2021-05-06 18:46:06 -07:00
Sean McManus 0ea25159d4 Merge branch 'main' into seanmcm/1_4_0_insiders 2021-05-06 18:41:47 -07:00
Colen Garoutte-Carson 143207aadb Merge to insiders (#7320) 2021-04-08 15:22:46 -07:00
Michelle Matias 0edf6c3ea7 Merge pull request #7304 from microsoft/mimatias/insiders4-2
1.3.0-insiders4 (#2)
2021-04-06 16:39:09 -07:00
Michelle Matias 4e22b6577f Merge pull request #7302 from microsoft/mimatias/insiders4
1.3.0-insiders4
2021-04-06 11:48:40 -07:00
Michelle Matias 1ab60bc247 Merge branch 'insiders' into mimatias/insiders4 2021-04-06 11:45:09 -07:00
Colen Garoutte-Carson 33eb2f6abe Add some files missed when merging to Insiders branch (#7271) 2021-04-01 12:15:23 -07:00
Colen Garoutte-Carson 11262438e3 Merge main into insiders (#7266) 2021-03-31 19:16:40 -07:00
Colen Garoutte-Carson 673a68d4cc Merge to insiders (#7236) 2021-03-25 14:05:32 -07:00
Sean McManus 437d9b333a Merge pull request #7223 from microsoft/1_3_0_insiders2
1.3.0-insiders2 merge
2021-03-24 12:10:49 -07:00
Sean McManus 0139274856 Change date. 2021-03-24 12:09:28 -07:00
Sean McManus 87cfa702bc Update changelog. 2021-03-24 06:04:49 -07:00
Sean McManus 013bff267e Merge branch 'insiders' into 1_3_0_insiders2 2021-03-24 05:53:35 -07:00
Colen Garoutte-Carson d942d64b7b Merge main to insiders (#7186) 2021-03-16 20:56:48 -07:00
Colen Garoutte-Carson 1a2bf6fc4c Merge main into insiders (#7180) 2021-03-16 17:44:59 -07:00
Sean McManus 32c1d6bf52 Merge pull request #6997 from microsoft/main
Merge for 1.2.2-insiders2
2021-02-18 18:13:59 -08:00
Sean McManus ebd5314b48 Merge pull request #6986 from microsoft/seanmcm/1_2_2_insiders
1.2.2-insiders
2021-02-17 15:01:04 -08:00
Sean McManus 5c7f551dba Merge. 2021-02-17 14:57:49 -08:00
Sean McManus 6ccea3878b Merge pull request #6853 from microsoft/seanmcm/1_2_0_insiders3
1.2.0-insiders3
2021-01-26 18:22:11 -08:00
Sean McManus e5fd036af9 Update changelog. 2021-01-26 17:40:57 -08:00
Sean McManus 4254419e76 Merge branch 'main' into seanmcm/1_2_0_insiders3 2021-01-26 17:27:51 -08:00
Sean McManus f9ecc9c6f9 Merge pull request #6820 from microsoft/seanmcm/1_2_0_insiders2
1.2.0-insiders2
2021-01-19 20:26:53 -08:00
Sean McManus 9405f41521 Merge branch 'main' into seanmcm/1_2_0_insiders2 2021-01-19 18:22:49 -08:00
Sean McManus 37cca41225 Merge pull request #6785 from microsoft/seanmcm/1_2_0_insiders_updates
1 2 0 insiders updates
2021-01-14 18:22:43 -08:00
Sean McManus ed584b23e2 Merge branch 'main' into seanmcm/1_2_0_insiders_updates 2021-01-14 18:21:56 -08:00
Sean McManus f7cab674a4 Merge branch 'main' into seanmcm/1_2_0_insiders_updates 2021-01-14 17:31:47 -08:00
Sean McManus 42586081fa Merge pull request #6777 from microsoft/seanmcm/1_2_0_insiders
Merge latest changes for 1.2.0-insiders
2021-01-13 18:56:37 -08:00
Sean McManus c49e51d386 Fix extra space. 2021-01-13 18:53:52 -08:00
15 changed files with 221 additions and 157 deletions
+5 -1
View File
@@ -1,6 +1,6 @@
# C/C++ for Visual Studio Code Change Log
## Version 1.11.1 (pre-release): June 29, 2022
## Version 1.11.1 (pre-release): July 7, 2022
### Enhancements
* Move "auto" inlay hints to the right by default and add `C_Cpp.inlayHints.autoDeclarationTypes.showOnLeft`. [#9478](https://github.com/microsoft/vscode-cpptools/issues/9478)
* Allow breakpoints for Rust debugging. [PR #9484](https://github.com/microsoft/vscode-cpptools/pull/9484)
@@ -10,12 +10,16 @@
### Bug Fixes
* Fix "unknown register name" IntelliSense error. [#4382](https://github.com/microsoft/vscode-cpptools/issues/4382)
* Fix performance issue with tag parsing a file with a lot of defines. [#6454](https://github.com/microsoft/vscode-cpptools/issues/6454)
* Fix missing logging when `C_Cpp.intelliSenseEngine` is set to `"Disabled"`. [#9277](https://github.com/microsoft/vscode-cpptools/issues/9277)
* Fix the code analysis "disable" option not automatically clearing the disabled diagnostics. [#9364](https://github.com/microsoft/vscode-cpptools/issues/9364)
* Fix `-isystem` not being used for system headers with code analysis. [#9366](https://github.com/microsoft/vscode-cpptools/issues/9366)
* Fix compiler querying for EDG-based compilers. [#9410](https://github.com/microsoft/vscode-cpptools/issues/9410)
* Fix bug with the environment being incorrect when compiler querying. [#9472](https://github.com/microsoft/vscode-cpptools/issues/9472)
* Fix inlay hints not having padding on the left if there is no existing space. [#9479](https://github.com/microsoft/vscode-cpptools/issues/9479)
* Fix duplicate inlay hints appearing sometimes. [#9487](https://github.com/microsoft/vscode-cpptools/issues/9487)
* Fix duplicate compiler args in compiler query with custom configuration providers using cpptools-api prior to v6. [#9531](https://github.com/microsoft/vscode-cpptools/issues/9531)
* Fix cl.exe build tasks not showing for .c files and .c build tasks being cached for .cpp files (and vice versa). [PR #9544](https://github.com/microsoft/vscode-cpptools/pull/9544)
* Fix process launching concurrency issues on Windows.
## Version 1.11.0 (pre-release): June 20, 2022
@@ -47,7 +47,7 @@
"windows.sdk.version": "Wersja zestawu Windows SDK",
"windows.sdk.version.description": "Wersja ścieżki dyrektywy include zestawu Windows SDK, która ma być używana w systemie Windows, np. {0}.",
"mac.framework.path": "Ścieżka do platformy Mac",
"mac.framework.path.description": "Lista ścieżek do użycia przez aparat IntelliSense podczas wyszukiwania dołączonych nagłówków z platform Mac. Obsługiwane tylko w przypadku konfiguracji dla systemu MacOS.",
"mac.framework.path.description": "Lista ścieżek do użycia przez aparat IntelliSense podczas wyszukiwania dołączonych nagłówków z platform Mac. Obsługiwane tylko w przypadku konfiguracji dla systemu macOS.",
"one.path.per.line": "Jedna ścieżka na wiersz.",
"forced.include": "Wymuszone dołączanie",
"forced.include.description": "Lista plików, które powinny zostać uwzględnione przed przetworzeniem każdego innego znaku w pliku źródłowym. Pliki są uwzględniane w podanej kolejności.",
@@ -38,6 +38,8 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
private assetProvider: IConfigurationAssetProvider;
// Keep a list of tasks detected by cppBuildTaskProvider.
private static detectedBuildTasks: CppBuildTask[] = [];
private static detectedCppBuildTasks: CppBuildTask[] = [];
private static detectedCBuildTasks: CppBuildTask[] = [];
protected static recentBuildTaskLabel: string;
public constructor(assetProvider: IConfigurationAssetProvider, type: DebuggerType) {
@@ -449,8 +451,44 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}
private async loadDetectedTasks(): Promise<void> {
if (!DebugConfigurationProvider.detectedBuildTasks || DebugConfigurationProvider.detectedBuildTasks.length === 0) {
DebugConfigurationProvider.detectedBuildTasks = await cppBuildTaskProvider.getTasks(true);
const editor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
const emptyTasks: CppBuildTask[] = [];
if (!editor) {
DebugConfigurationProvider.detectedBuildTasks = emptyTasks;
return;
}
const fileExt: string = path.extname(editor.document.fileName);
if (!fileExt) {
DebugConfigurationProvider.detectedBuildTasks = emptyTasks;
return;
}
// Don't offer tasks for header files.
const isHeader: boolean = util.isHeaderFile (editor.document.uri);
if (isHeader) {
DebugConfigurationProvider.detectedBuildTasks = emptyTasks;
return;
}
// Don't offer tasks if the active file's extension is not a recognized C/C++ extension.
const fileIsCpp: boolean = util.isCppFile(editor.document.uri);
const fileIsC: boolean = util.isCFile(editor.document.uri);
if (!(fileIsCpp || fileIsC)) {
DebugConfigurationProvider.detectedBuildTasks = emptyTasks;
return;
}
if (fileIsCpp) {
if (!DebugConfigurationProvider.detectedCppBuildTasks || DebugConfigurationProvider.detectedCppBuildTasks.length === 0) {
DebugConfigurationProvider.detectedCppBuildTasks = await cppBuildTaskProvider.getTasks(true);
}
DebugConfigurationProvider.detectedBuildTasks = DebugConfigurationProvider.detectedCppBuildTasks;
} else {
if (!DebugConfigurationProvider.detectedCBuildTasks || DebugConfigurationProvider.detectedCBuildTasks.length === 0) {
DebugConfigurationProvider.detectedCBuildTasks = await cppBuildTaskProvider.getTasks(true);
}
DebugConfigurationProvider.detectedBuildTasks = DebugConfigurationProvider.detectedCBuildTasks;
}
}
@@ -4,14 +4,12 @@
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { Position, Range, RequestType, TextEdit } from 'vscode-languageclient';
import * as util from '../../common';
import { DefaultClient } from '../client';
import { CodeActionCodeInfo, CodeActionDiagnosticInfo, codeAnalysisFileToCodeActions, codeAnalysisCodeToFixes,
codeAnalysisAllFixes } from '../codeAnalysis';
import { makeVscodeRange } from '../utils';
import { CppSettings } from '../settings';
type LocalizeStringParams = util.LocalizeStringParams;
import { getLocalizedString, LocalizeStringParams } from '../localization';
interface GetCodeActionsRequestParams {
uri: string;
@@ -63,7 +61,7 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
// Convert to vscode.CodeAction array
commands.forEach((command) => {
const title: string = util.getLocalizedString(command.localizeStringParams);
const title: string = getLocalizedString(command.localizeStringParams);
let wsEdit: vscode.WorkspaceEdit | undefined;
let codeActionKind: vscode.CodeActionKind = vscode.CodeActionKind.QuickFix;
if (command.edit) {
@@ -4,9 +4,9 @@
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { DefaultClient, LocalizeDocumentSymbol, GetDocumentSymbolRequestParams, GetDocumentSymbolRequest, SymbolScope } from '../client';
import * as util from '../../common';
import { processDelayedDidOpen } from '../extension';
import { makeVscodeRange } from '../utils';
import { getLocalizedString, getLocalizedSymbolScope } from '../localization';
export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
private client: DefaultClient;
@@ -17,18 +17,18 @@ export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
const documentSymbols: vscode.DocumentSymbol[] = [];
if (symbols) {
symbols.forEach((symbol) => {
let detail: string = util.getLocalizedString(symbol.detail);
let detail: string = getLocalizedString(symbol.detail);
if (symbol.scope === SymbolScope.Private) {
if (detail.length === 0) {
detail = "private";
} else {
detail = util.getLocalizedSymbolScope("private", detail);
detail = getLocalizedSymbolScope("private", detail);
}
} else if (symbol.scope === SymbolScope.Protected) {
if (detail.length === 0) {
detail = "protected";
} else {
detail = util.getLocalizedSymbolScope("protected", detail);
detail = getLocalizedSymbolScope("protected", detail);
}
}
@@ -5,7 +5,7 @@
import * as vscode from 'vscode';
import { DefaultClient, GetSymbolInfoRequest, WorkspaceSymbolParams, LocalizeSymbolInformation, SymbolScope } from '../client';
import { makeVscodeLocation } from '../utils';
import * as util from '../../common';
import { getLocalizedString, getLocalizedSymbolScope } from '../localization';
export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
private client: DefaultClient;
@@ -23,13 +23,13 @@ export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
// Convert to vscode.Command array
symbols.forEach((symbol) => {
let suffix: string = util.getLocalizedString(symbol.suffix);
let suffix: string = getLocalizedString(symbol.suffix);
let name: string = symbol.name;
if (suffix.length) {
if (symbol.scope === SymbolScope.Private) {
suffix = util.getLocalizedSymbolScope("private", suffix);
suffix = getLocalizedSymbolScope("private", suffix);
} else if (symbol.scope === SymbolScope.Protected) {
suffix = util.getLocalizedSymbolScope("protected", suffix);
suffix = getLocalizedSymbolScope("protected", suffix);
}
name = name + ' (' + suffix + ')';
} else {
+11 -66
View File
@@ -24,7 +24,7 @@ import { InlayHintsProvider } from './Providers/inlayHintProvider';
import { LanguageClient, LanguageClientOptions, ServerOptions, NotificationType, TextDocumentIdentifier, RequestType, ErrorAction, CloseAction, DidOpenTextDocumentParams, Range, Position, DocumentFilter } from 'vscode-languageclient';
import { SourceFileConfigurationItem, WorkspaceBrowseConfiguration, SourceFileConfiguration, Version } from 'vscode-cpptools';
import { Status, IntelliSenseStatus } from 'vscode-cpptools/out/testApi';
import { getLocalizedString, LocalizeStringParams } from './localization';
import { getLocaleId, getLocalizedString, LocalizeStringParams } from './localization';
import { Location, TextEdit } from './commonTypes';
import { makeVscodeRange, makeVscodeLocation } from './utils';
import * as util from '../common';
@@ -37,7 +37,6 @@ import { ClientCollection } from './clientCollection';
import { createProtocolFilter } from './protocolFilter';
import { DataBinding } from './dataBinding';
import minimatch = require("minimatch");
import * as logger from '../logger';
import { updateLanguageConfigurations, CppSourceStr } from './extension';
import { SettingsTracker, getTracker } from './settingsTracker';
import { getTestHook, TestHook } from '../testHook';
@@ -49,6 +48,7 @@ import * as nls from 'vscode-nls';
import { lookupString, localizedStringCount } from '../nativeStrings';
import { CodeAnalysisDiagnosticIdentifiersAndUri, RegisterCodeAnalysisNotifications, removeAllCodeAnalysisProblems,
removeCodeAnalysisProblems, RemoveCodeAnalysisProblemsParams } from './codeAnalysis';
import { DebugProtocolParams, getDiagnosticsChannel, getOutputChannelLogger, logDebugProtocol, Logger, logLocalized, showWarning, ShowWarningParams } from '../logger';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -64,10 +64,6 @@ const languageClientCrashTimes: number[] = [];
let clientCollection: ClientCollection;
let pendingTask: util.BlockingTask<any> | undefined;
let compilerDefaults: configs.CompilerDefaults;
let diagnosticsChannel: vscode.OutputChannel;
let outputChannel: vscode.OutputChannel;
let debugChannel: vscode.OutputChannel;
let warningChannel: vscode.OutputChannel;
let diagnosticsCollectionIntelliSense: vscode.DiagnosticCollection;
let workspaceDisposables: vscode.Disposable[] = [];
@@ -91,32 +87,10 @@ function logTelemetry(notificationBody: TelemetryPayload): void {
function setupOutputHandlers(): void {
console.assert(languageClient !== undefined, "This method must not be called until this.languageClient is set in \"onReady\"");
languageClient.onNotification(DebugProtocolNotification, (output) => {
if (!debugChannel) {
debugChannel = vscode.window.createOutputChannel(`${localize("c.cpp.debug.protocol", "C/C++ Debug Protocol")}`);
workspaceDisposables.push(debugChannel);
}
debugChannel.appendLine("");
debugChannel.appendLine("************************************************************************************************************************");
debugChannel.append(`${output}`);
});
languageClient.onNotification(DebugProtocolNotification, logDebugProtocol);
languageClient.onNotification(DebugLogNotification, logLocalized);
}
function log(output: string): void {
if (!outputChannel) {
outputChannel = logger.getOutputChannel();
workspaceDisposables.push(outputChannel);
}
outputChannel.appendLine(`${output}`);
}
function logLocalized(params: LocalizeStringParams): void {
const output: string = getLocalizedString(params);
log(output);
}
/** Note: We should not await on the following functions,
* or any funstion that returns a promise acquired from them,
* vscode.window.showInformationMessage, vscode.window.showWarningMessage, vscode.window.showErrorMessage
@@ -139,21 +113,6 @@ function showMessageWindow(params: ShowMessageWindowParams): void {
}
}
function showWarning(params: ShowWarningParams): void {
const message: string = getLocalizedString(params.localizeStringParams);
let showChannel: boolean = false;
if (!warningChannel) {
warningChannel = vscode.window.createOutputChannel(`${localize("c.cpp.warnings", "C/C++ Configuration Warnings")}`);
workspaceDisposables.push(warningChannel);
showChannel = true;
}
// Append before showing the channel, to avoid a delay.
warningChannel.appendLine(`[${new Date().toLocaleString()}] ${message}`);
if (showChannel) {
warningChannel.show(true);
}
}
function publishIntelliSenseDiagnostics(params: PublishIntelliSenseDiagnosticsParams): void {
if (!diagnosticsCollectionIntelliSense) {
diagnosticsCollectionIntelliSense = vscode.languages.createDiagnosticCollection(CppSourceStr);
@@ -192,12 +151,6 @@ interface TelemetryPayload {
metrics?: { [key: string]: number };
}
interface DebugProtocolParams {
jsonrpc: string;
method: string;
params?: any;
}
interface ReportStatusNotificationBody extends WorkspaceFolderParams {
status: string;
}
@@ -301,10 +254,6 @@ interface ShowMessageWindowParams {
localizeStringParams: LocalizeStringParams;
}
interface ShowWarningParams {
localizeStringParams: LocalizeStringParams;
}
export interface GetDocumentSymbolRequestParams {
uri: string;
}
@@ -1378,7 +1327,7 @@ export class DefaultClient implements Client {
},
vcpkg_root: util.getVcpkgRoot(),
experimentalFeatures: workspaceSettings.experimentalFeatures,
edgeMessagesDirectory: path.join(util.getExtensionFilePath("bin"), "messages", util.getLocaleId()),
edgeMessagesDirectory: path.join(util.getExtensionFilePath("bin"), "messages", getLocaleId()),
localizedStrings: localizedStrings,
packageVersion: util.packageJson.version,
legacyCompilerArgsBehavior: settings_legacyCompilerArgsBehavior
@@ -1518,7 +1467,7 @@ export class DefaultClient implements Client {
this.loggingLevel = newLoggingLevel;
const newLoggingLevelLogged: boolean = !!newLoggingLevel && newLoggingLevel !== "None" && newLoggingLevel !== "Error";
if (oldLoggingLevelLogged || newLoggingLevelLogged) {
const out: logger.Logger = logger.getOutputChannelLogger();
const out: Logger = getOutputChannelLogger();
out.appendLine(localize({ key: "loggingLevel.changed", comment: ["{0} is the setting name 'loggingLevel', {1} is a string value such as 'Debug'"] }, "{0} has changed to: {1}", "loggingLevel", changedSettings["loggingLevel"]));
}
}
@@ -1810,12 +1759,8 @@ export class DefaultClient implements Client {
public async logDiagnostics(): Promise<void> {
const response: GetDiagnosticsResult = await this.requestWhenReady(() => this.languageClient.sendRequest(GetDiagnosticsRequest, null));
if (!diagnosticsChannel) {
diagnosticsChannel = vscode.window.createOutputChannel(localize("c.cpp.diagnostics", "C/C++ Diagnostics"));
workspaceDisposables.push(diagnosticsChannel);
} else {
diagnosticsChannel.clear();
}
const diagnosticsChannel: vscode.OutputChannel = getDiagnosticsChannel();
diagnosticsChannel.clear();
const header: string = `-------- Diagnostics - ${new Date().toLocaleString()}\n`;
const version: string = `Version: ${util.packageJson.version}\n`;
@@ -2352,7 +2297,7 @@ export class DefaultClient implements Client {
} else if (message.endsWith("IntelliSense done")) {
const settings: CppSettings = new CppSettings();
if (settings.loggingLevel === "Debug") {
const out: logger.Logger = logger.getOutputChannelLogger();
const out: Logger = getOutputChannelLogger();
const duration: number = Date.now() - timeStamp;
out.appendLine(localize("update.intellisense.time", "Update IntelliSense time (sec): {0}", duration / 1000));
}
@@ -2425,7 +2370,7 @@ export class DefaultClient implements Client {
}
private updateTagParseStatus(notificationBody: LocalizeStringParams): void {
this.model.parsingWorkspaceStatus.Value = util.getLocalizedString(notificationBody);
this.model.parsingWorkspaceStatus.Value = getLocalizedString(notificationBody);
if (notificationBody.text.startsWith("Workspace parsing paused")) {
this.model.isParsingWorkspacePausable.Value = true;
this.model.isParsingWorkspacePaused.Value = true;
@@ -2768,7 +2713,7 @@ export class DefaultClient implements Client {
}
const settings: CppSettings = new CppSettings();
const out: logger.Logger = logger.getOutputChannelLogger();
const out: Logger = getOutputChannelLogger();
if (settings.loggingLevel === "Debug") {
out.appendLine(localize("configurations.received", "Custom configurations received:"));
}
@@ -2872,7 +2817,7 @@ export class DefaultClient implements Client {
const settings: CppSettings = new CppSettings();
if (settings.loggingLevel === "Debug") {
const out: logger.Logger = logger.getOutputChannelLogger();
const out: Logger = getOutputChannelLogger();
out.appendLine(localize("browse.configuration.received", "Custom browse configuration received: {0}", JSON.stringify(sanitized, null, 2)));
}
@@ -295,7 +295,6 @@ export class ClientCollection {
// this.defaultClient is already in this.languageClients, so do not call dispose() on it.
this.languageClients.forEach(client => client.dispose());
this.languageClients.clear();
cpptools.disposeWorkspaceData();
return cpptools.DefaultClient.stopLanguageClient();
}
}
@@ -122,10 +122,19 @@ export class CppBuildTaskProvider implements TaskProvider {
const knownCompilerPathsSet: Set<string> = new Set();
let knownCompilers: configs.KnownCompiler[] | undefined = await activeClient.getKnownCompilers();
if (knownCompilers) {
const compiler_condition: (info: configs.KnownCompiler) => boolean = info => ((fileIsCpp && !info.isC) || (fileIsC && info.isC)) &&
(!isCompilerValid || (!!userCompilerPathAndArgs &&
(path.basename(info.path) !== userCompilerPathAndArgs.compilerName))) &&
(!isWindows || !info.path.startsWith("/")); // TODO: Add WSL compiler support.
const compiler_condition: (info: configs.KnownCompiler) => boolean = info =>
(
// Filter out c compilers for cpp files and vice versa, except for cl.exe, which handles both.
path.basename(info.path) === "cl.exe" ||
(fileIsCpp && !info.isC) || (fileIsC && info.isC)
) &&
(
!isCompilerValid || (!!userCompilerPathAndArgs &&
(path.basename(info.path) !== userCompilerPathAndArgs.compilerName))
) &&
(
!isWindows || !info.path.startsWith("/")
); // TODO: Add WSL compiler support.
const cl_to_add: configs.KnownCompiler | undefined = userCompilerIsCl ? undefined : knownCompilers.find(info =>
((path.basename(info.path) === "cl.exe") && compiler_condition(info)));
knownCompilers = knownCompilers.filter(info =>
@@ -4,7 +4,14 @@
* ------------------------------------------------------------------------------------------ */
'use strict';
import { getExtensionFilePath } from '../common';
import { lookupString } from '../nativeStrings';
import * as nls from 'vscode-nls';
import path = require('path');
import * as fs from 'fs';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
export interface LocalizeStringParams {
text: string;
@@ -24,3 +31,45 @@ export function getLocalizedString(params: LocalizeStringParams): string {
}
return indent + text;
}
interface VSCodeNlsConfig {
locale: string;
availableLanguages: {
[pack: string]: string;
};
}
export function getLocaleId(): string {
// This replicates the language detection used by initializeSettings() in vscode-nls
if (typeof process.env.VSCODE_NLS_CONFIG === 'string') {
const vscodeOptions: VSCodeNlsConfig = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
if (vscodeOptions.availableLanguages) {
const value: any = vscodeOptions.availableLanguages['*'];
if (typeof value === 'string') {
return value;
}
}
if (typeof vscodeOptions.locale === 'string') {
return vscodeOptions.locale.toLowerCase();
}
}
return "en";
}
export function getLocalizedHtmlPath(originalPath: string): string {
const locale: string = getLocaleId();
if (!locale.startsWith("en")) {
const localizedFilePath: string = getExtensionFilePath(path.join("dist/html/", locale, originalPath));
if (fs.existsSync(localizedFilePath)) {
return localizedFilePath;
}
}
return getExtensionFilePath(originalPath);
}
export function getLocalizedSymbolScope(scope: string, detail: string): string {
return localize({
key: "c.cpp.symbolscope.separator", comment:
["{0} is an untranslated C++ keyword (e.g. \"private\") and {1} is either another keyword (e.g. \"typedef\") or a localized property (e.g. a localized version of \"declaration\""]
}, "{0}, {1}", scope, detail);
}
@@ -10,6 +10,7 @@ import * as vscode from 'vscode';
import * as util from '../common';
import * as config from './configurations';
import * as telemetry from '../telemetry';
import { getLocalizedHtmlPath } from './localization';
// TODO: share ElementId between SettingsPanel and SettingsApp. Investigate why SettingsApp cannot import/export
const elementId: { [key: string]: string } = {
@@ -373,7 +374,7 @@ export class SettingsPanel {
private getHtml(): string {
let content: string | undefined;
content = fs.readFileSync(util.getLocalizedHtmlPath("ui/settings.html")).toString();
content = fs.readFileSync(getLocalizedHtmlPath("ui/settings.html")).toString();
if (this.panel && this.panel.webview) {
const cppImageUri: vscode.Uri = this.panel.webview.asWebviewUri(vscode.Uri.file(path.join(util.extensionPath, 'LanguageCCPP_color_128x.png')));
-62
View File
@@ -17,7 +17,6 @@ import * as assert from 'assert';
import * as https from 'https';
import * as tmp from 'tmp';
import { ClientRequest, OutgoingHttpHeaders } from 'http';
import { lookupString } from './nativeStrings';
import * as nls from 'vscode-nls';
import { Readable } from 'stream';
import * as jsonc from 'comment-json';
@@ -1197,67 +1196,6 @@ export class BlockingTask<T> {
}
}
interface VSCodeNlsConfig {
locale: string;
availableLanguages: {
[pack: string]: string;
};
}
export function getLocaleId(): string {
// This replicates the language detection used by initializeSettings() in vscode-nls
if (isString(process.env.VSCODE_NLS_CONFIG)) {
const vscodeOptions: VSCodeNlsConfig = JSON.parse(process.env.VSCODE_NLS_CONFIG) as VSCodeNlsConfig;
if (vscodeOptions.availableLanguages) {
const value: any = vscodeOptions.availableLanguages['*'];
if (isString(value)) {
return value;
}
}
if (isString(vscodeOptions.locale)) {
return vscodeOptions.locale.toLowerCase();
}
}
return "en";
}
export function getLocalizedHtmlPath(originalPath: string): string {
const locale: string = getLocaleId();
if (!locale.startsWith("en")) {
const localizedFilePath: string = getExtensionFilePath(path.join("dist/html/", locale, originalPath));
if (fs.existsSync(localizedFilePath)) {
return localizedFilePath;
}
}
return getExtensionFilePath(originalPath);
}
export interface LocalizeStringParams {
text: string;
stringId: number;
stringArgs: string[];
indentSpaces: number;
}
export function getLocalizedString(params: LocalizeStringParams): string {
let indent: string = "";
if (params.indentSpaces) {
indent = " ".repeat(params.indentSpaces);
}
let text: string = params.text;
if (params.stringId !== 0) {
text = lookupString(params.stringId, params.stringArgs);
}
return indent + text;
}
export function getLocalizedSymbolScope(scope: string, detail: string): string {
return localize({
key: "c.cpp.symbolscope.separator", comment:
["{0} is an untranslated C++ keyword (e.g. \"private\") and {1} is either another keyword (e.g. \"typedef\") or a localized property (e.g. a localized version of \"declaration\""]
}, "{0}, {1}", scope, detail);
}
function decodeUCS16(input: string): number[] {
const output: number[] = [];
let counter: number = 0;
+76 -1
View File
@@ -8,6 +8,11 @@ import * as vscode from 'vscode';
import * as os from 'os';
import { CppSettings } from './LanguageServer/settings';
import { CppSourceStr } from './LanguageServer/extension';
import * as nls from 'vscode-nls';
import { getLocalizedString, LocalizeStringParams } from './LanguageServer/localization';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
// This is used for testing purposes
let Subscriber: (message: string) => void;
@@ -67,7 +72,10 @@ export class Logger {
}
}
let outputChannel: vscode.OutputChannel | undefined;
export let outputChannel: vscode.OutputChannel | undefined;
export let diagnosticsChannel: vscode.OutputChannel | undefined;
export let debugChannel: vscode.OutputChannel | undefined;
export let warningChannel: vscode.OutputChannel | undefined;
export function getOutputChannel(): vscode.OutputChannel {
if (!outputChannel) {
@@ -81,6 +89,13 @@ export function getOutputChannel(): vscode.OutputChannel {
return outputChannel;
}
export function getDiagnosticsChannel(): vscode.OutputChannel {
if (!diagnosticsChannel) {
diagnosticsChannel = vscode.window.createOutputChannel(localize("c.cpp.diagnostics", "C/C++ Diagnostics"));
}
return diagnosticsChannel;
}
export function showOutputChannel(): void {
getOutputChannel().show();
}
@@ -93,3 +108,63 @@ export function getOutputChannelLogger(): Logger {
}
return outputChannelLogger;
}
export function log(output: string): void {
if (!outputChannel) {
outputChannel = getOutputChannel();
}
outputChannel.appendLine(`${output}`);
}
export interface DebugProtocolParams {
jsonrpc: string;
method: string;
params?: any;
}
export function logDebugProtocol(output: DebugProtocolParams): void {
if (!debugChannel) {
debugChannel = vscode.window.createOutputChannel(`${localize("c.cpp.debug.protocol", "C/C++ Debug Protocol")}`);
}
debugChannel.appendLine("");
debugChannel.appendLine("************************************************************************************************************************");
debugChannel.append(`${output}`);
}
export interface ShowWarningParams {
localizeStringParams: LocalizeStringParams;
}
export function showWarning(params: ShowWarningParams): void {
const message: string = getLocalizedString(params.localizeStringParams);
let showChannel: boolean = false;
if (!warningChannel) {
warningChannel = vscode.window.createOutputChannel(`${localize("c.cpp.warnings", "C/C++ Configuration Warnings")}`);
showChannel = true;
}
// Append before showing the channel, to avoid a delay.
warningChannel.appendLine(`[${new Date().toLocaleString()}] ${message}`);
if (showChannel) {
warningChannel.show(true);
}
}
export function logLocalized(params: LocalizeStringParams): void {
const output: string = getLocalizedString(params);
log(output);
}
export function disposeOutputChannels(): void {
if (outputChannel) {
outputChannel.dispose();
}
if (diagnosticsChannel) {
diagnosticsChannel.dispose();
}
if (debugChannel) {
debugChannel.dispose();
}
if (warningChannel) {
warningChannel.dispose();
}
}
+13 -5
View File
@@ -21,6 +21,8 @@ import { TargetPopulation } from 'vscode-tas-client';
import * as semver from 'semver';
import * as nls from 'vscode-nls';
import { cppBuildTaskProvider, CppBuildTaskProvider } from './LanguageServer/cppBuildTaskProvider';
import { getLocaleId, getLocalizedHtmlPath } from './LanguageServer/localization';
import { disposeOutputChannels, log } from './logger';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -40,7 +42,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
public async provideTextDocumentContent(uri: vscode.Uri): Promise<string> {
console.assert(uri.path[0] === '/', "A preceeding slash is expected on schema uri path");
const fileName: string = uri.path.substring(1);
const locale: string = util.getLocaleId();
const locale: string = getLocaleId();
let localizedFilePath: string = util.getExtensionFilePath(path.join("dist/schema/", locale, fileName));
const fileExists: boolean = await util.checkFileExists(localizedFilePath);
if (!fileExists) {
@@ -79,7 +81,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
// Read the setting and determine whether we should activate the language server prior to installing callbacks,
// to ensure there is no potential race condition. LanguageServer.activate() is called near the end of this
// function, to allow any further setup to occur here, prior to activation.
const shouldActivateLanguageServer: boolean = (settings.intelliSenseEngine !== "Disabled" && !isOldMacOs);
const isIntelliSenseEngineDisabled: boolean = settings.intelliSenseEngine === "Disabled";
const shouldActivateLanguageServer: boolean = (!isIntelliSenseEngineDisabled && !isOldMacOs);
if (isOldMacOs) {
languageServiceDisabled = true;
@@ -134,19 +137,24 @@ export async function activate(context: vscode.ExtensionContext): Promise<CppToo
if (shouldActivateLanguageServer) {
await LanguageServer.activate();
} else if (isIntelliSenseEngineDisabled) {
// The check here for isIntelliSenseEngineDisabled avoids logging
// the message on old Macs that we've already displayed a warning for.
log(localize("intellisense.disabled", "intelliSenseEngine is Disabled"));
}
return cppTools;
}
export function deactivate(): Thenable<void> {
export async function deactivate(): Promise<void> {
DebuggerExtension.dispose();
Telemetry.deactivate();
disposables.forEach(d => d.dispose());
if (languageServiceDisabled) {
return Promise.resolve();
}
return LanguageServer.deactivate();
await LanguageServer.deactivate();
disposeOutputChannels();
}
async function makeBinariesExecutable(): Promise<void> {
@@ -322,7 +330,7 @@ async function checkVsixCompatibility(): Promise<void> {
if (promise) {
promise.then(async (value) => {
if (value === moreInfoButton) {
await vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(util.getLocalizedHtmlPath("Reinstalling the Extension.md")));
await vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(getLocalizedHtmlPath("Reinstalling the Extension.md")));
} else if (value === ignoreButton) {
ignoreMismatchedCompatibleVsix.Value = true;
}
+1 -1
View File
@@ -6181,4 +6181,4 @@ yauzl@^2.10.0:
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==