diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 743b46aef1..a0a0c1e9bf 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,57 +1,59 @@ # C/C++ for Visual Studio Code Change Log -## Version 1.11.3 (pre-release): July 19, 2022 -### New Feature -* Added extended remote support for debugging. [#8497](https://github.com/microsoft/vscode-cpptools/issues/8497), [#9195](https://github.com/microsoft/vscode-cpptools/issues/9195), [#9491](https://github.com/microsoft/vscode-cpptools/discussions/9491), [#9505](https://github.com/microsoft/vscode-cpptools/issues/9505) - -### Bug Fixes -* Fix doc comments for macros and typedefs. [#8320](https://github.com/microsoft/vscode-cpptools/issues/8320) -* Fix issue with CUDA configuration when using a custom config provider and no config is available for the file. [#8483](https://github.com/microsoft/vscode-cpptools/issues/8483) -* Fix code analysis not detecting warnings with relative paths. [#9555](https://github.com/microsoft/vscode-cpptools/issues/9555) -* Fix `--header-filter` being used with clang-tidy when it shouldn't when a .clang-tidy file exists. [#9566](https://github.com/microsoft/vscode-cpptools/issues/9566) -* Fix code analysis giving an error with `__has_include` with gcc 9. [#9575](https://github.com/microsoft/vscode-cpptools/issues/9575) -* Fix `-target` not being processed in `compilerArgs`. [#9586](https://github.com/microsoft/vscode-cpptools/issues/9586) -## Version 1.11.2 (pre-release): July 8, 2022 -### Enhancements -* Add deploySteps and variables to cppdbg. [PR #9418](https://github.com/microsoft/vscode-cpptools/pull/9418) +## Version 1.12.0 (pre-release): July 27, 2022 +## Enhancements +* Show an informative message when an IntelliSense-related command is executed while IntelliSense is disabled. [#9614](https://github.com/microsoft/vscode-cpptools/issues/9614) +* Add the `.vs` folder to the default exclusions. [PR #9629](https://github.com/microsoft/vscode-cpptools/pull/9629) + +## Bug Fixes +* Fix some IntelliSense parsing bugs. [#3683](https://github.com/microsoft/vscode-cpptools/issues/3683), [#6659](https://github.com/microsoft/vscode-cpptools/issues/6659) +* Fix `.` to `->` completion in functions defined in the class/struct definition. [#9599](https://github.com/microsoft/vscode-cpptools/issues/9599) +* Fix inlay hint filtering not working with some cases of whitespace. [#9606](https://github.com/microsoft/vscode-cpptools/issues/9606) +* Fix Chinese translation mistakes. + * kouhe3 (@kouhe3) [PR #9624](https://github.com/microsoft/vscode-cpptools/pull/9624) +* Fix IntelliSense error with ARM register declarations. [#9627](https://github.com/microsoft/vscode-cpptools/issues/9627) +* Fix files with a `.c` extension not using a C++ `std` version passed in the `compilerArgs` or `compilerFragments`. [#9628](https://github.com/microsoft/vscode-cpptools/issues/9628) +* Fix unnecessary IntelliSense process restarting on file creation handling. [#9630](https://github.com/microsoft/vscode-cpptools/issues/9630) +* Fix potential crashes on shutdown. + +## Version 1.11.4: July 21, 2022 +## New Features +* Add inlay hints for parameters and auto types. [#5845](https://github.com/microsoft/vscode-cpptools/issues/5845) +* Add extended remote support for debugging. [#8497](https://github.com/microsoft/vscode-cpptools/issues/8497), [#9195](https://github.com/microsoft/vscode-cpptools/issues/9195), [#9491](https://github.com/microsoft/vscode-cpptools/discussions/9491), [#9505](https://github.com/microsoft/vscode-cpptools/issues/9505) -## Version 1.11.2 (pre-release): July 8, 2022 -### Enhancements +## Enhancements * Add deploySteps and variables to cppdbg. [PR #9418](https://github.com/microsoft/vscode-cpptools/pull/9418) -## 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) -* Remove `_` from the start of parameter inlay hints and add `C_Cpp.inlayHints.parameterNames.hideLeadingUnderscores`. [#9485](https://github.com/microsoft/vscode-cpptools/issues/9485) -* Add `C_Cpp.inlayHints.referenceOperator.showSpace` setting. [#9486](https://github.com/microsoft/vscode-cpptools/issues/9486) -* Make `C_Cpp.debugShortcut` settable per-workspace folder. [PR #9514](https://github.com/microsoft/vscode-cpptools/pull/9514) - -### Bug Fixes +## 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 IntelliSense with gcc vector extension types. [#6890](https://github.com/microsoft/vscode-cpptools/issues/6890) +* Fix doc comments for macros and typedefs. [#8320](https://github.com/microsoft/vscode-cpptools/issues/8320) +* Fix issue with CUDA configuration when using a custom config provider and no config is available for the file. [#8483](https://github.com/microsoft/vscode-cpptools/issues/8483) * Fix missing logging when `C_Cpp.intelliSenseEngine` is set to `"Disabled"`. [#9277](https://github.com/microsoft/vscode-cpptools/issues/9277) +* Fix doxygen comments not being displayed for multiple adjacent `@brief` or `@return` tags. [#9316](https://github.com/microsoft/vscode-cpptools/issues/9316) * 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 hiding IntelliSense dependent commands when `C_Cpp.intelliSenseEngine` is `"Disabled"`. [#9451](https://github.com/microsoft/vscode-cpptools/issues/9451) * 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. +* Fix code analysis not detecting warnings with relative paths. [#9555](https://github.com/microsoft/vscode-cpptools/issues/9555) +* Fix `--header-filter` being used with clang-tidy when it shouldn't when a .clang-tidy file exists. [#9566](https://github.com/microsoft/vscode-cpptools/issues/9566) +* Fix code analysis giving an error with `__has_include` with gcc 9. [#9575](https://github.com/microsoft/vscode-cpptools/issues/9575) +* Fix `-target` not being processed in `compilerArgs`. [#9586](https://github.com/microsoft/vscode-cpptools/issues/9586) -## Version 1.11.0 (pre-release): June 20, 2022 -### New Features -* Add inlay hints for parameters and auto types. [#5845](https://github.com/microsoft/vscode-cpptools/issues/5845) +## Version 1.10.8: July 7, 2022 +### Enhancements +* Allow breakpoints for Rust debugging. [PR #9484](https://github.com/microsoft/vscode-cpptools/pull/9484) +* Make `C_Cpp.debugShortcut` settable per-workspace folder. [PR #9514](https://github.com/microsoft/vscode-cpptools/pull/9514) ### Bug Fixes -* Fix doxygen comments not being displayed for multiple adjacent `@brief` or `@return` tags. [#9316](https://github.com/microsoft/vscode-cpptools/issues/9316) * Fix crash if clang-tidy returns a replacement with an empty FilePath. [#9437](https://github.com/microsoft/vscode-cpptools/issues/9437) -* Fix hiding IntelliSense dependent commands when `C_Cpp.intelliSenseEngine` is `"Disabled"`. [#9451](https://github.com/microsoft/vscode-cpptools/issues/9451) * Fix skipping the compiler argument after `-c`. [#9453](https://github.com/microsoft/vscode-cpptools/issues/9453) * Fix `-std:c++20` not being handled with cl.exe. [#9458](https://github.com/microsoft/vscode-cpptools/issues/9458) +* Fix bug with the environment being incorrect when compiler querying. [#9472](https://github.com/microsoft/vscode-cpptools/issues/9472) +* 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 process launching concurrency issues on Windows. ## Version 1.10.7: June 15, 2022 ### Bug Fixes diff --git a/Extension/i18n/chs/package.i18n.json b/Extension/i18n/chs/package.i18n.json index 4d7b8c9cf8..1bac80b3b1 100644 --- a/Extension/i18n/chs/package.i18n.json +++ b/Extension/i18n/chs/package.i18n.json @@ -171,13 +171,13 @@ "c_cpp.configuration.inactiveRegionOpacity.markdownDescription": "控制非活动预处理器块的不透明度。在 `0.1` 和 `1.0` 之间进行缩放。仅当启用非活动区域暗化时,此设置才适用。", "c_cpp.configuration.inactiveRegionForegroundColor.description": "控制非活动预处理程序块的字体颜色。输入的格式为十六进制颜色代码或有效的主题颜色。如果未设置,则默认为编辑器的语法颜色方案。此设置仅在启用非活动区域变暗时适用。", "c_cpp.configuration.inactiveRegionBackgroundColor.description": "控制非活动预处理程序块的背景颜色。输入的格式为十六进制颜色代码或有效的主题颜色。如果未设置,则默认为透明。此设置仅在启用了非活动区域变暗时适用。", - "c_cpp.configuration.inlayHints.autoDeclarationTypes.enabled.markdownDescription": "在声明中使用 `auto` 时显示推导类型的内嵌提示:\n```cpp \n\n 自动索引 /* : int */ = 0;\n```", + "c_cpp.configuration.inlayHints.autoDeclarationTypes.enabled.markdownDescription": "在声明中使用 `auto` 时显示推导类型的内嵌提示:\n```cpp \n\n auto index /* : int */ = 0;\n```", "c_cpp.configuration.inlayHints.autoDeclarationTypes.showOnLeft.markdownDescription": "在标识符左侧声明中使用 `auto` 时显示推导类型的内嵌提示:\n```cpp \n\n auto /* int */ index = 0;\n```", "c_cpp.configuration.inlayHints.parameterNames.enabled.markdownDescription": "显示参数名称的内嵌提示:\n```cpp \n\n int a = getArea(/* width: */ x, /* height: */ y);\n```", "c_cpp.configuration.inlayHints.parameterNames.hideLeadingUnderscores.markdownDescription": "在参数名称提示中隐藏开头的`_`。", - "c_cpp.configuration.inlayHints.parameterNames.suppressWhenArgumentContainsName.markdownDescription": "当参数文本或内联注释包含参数名称时,抑制参数名称提示:\n```cpp \n\n int a = getArea(width, /* height: */ y);\n```", - "c_cpp.configuration.inlayHints.referenceOperator.enabled.markdownDescription": "显示非常量引用传递的参数的内嵌提示引用运算符 `&`:\n```cpp \n\n 交换(/* &first: */ str1, /* &last: */ str2);\n```", - "c_cpp.configuration.inlayHints.referenceOperator.showSpace.markdownDescription": "控制在 `&` 后是否显示非常量引用传递的参数的空格:\n```cpp \n\n 交换(/* & first: */ str1, /* & last: */ str2);\n```", + "c_cpp.configuration.inlayHints.parameterNames.suppressWhenArgumentContainsName.markdownDescription": "当参数文本或内联注释包含参数名称时,隐藏参数名称提示:\n```cpp \n\n int a = getArea(width, /* height: */ y);\n```", + "c_cpp.configuration.inlayHints.referenceOperator.enabled.markdownDescription": "显示非 const 引用传递的参数的内嵌提示引用运算符 `&`:\n```cpp \n\n swap(/* &first: */ str1, /* &last: */ str2);\n```", + "c_cpp.configuration.inlayHints.referenceOperator.showSpace.markdownDescription": "控制在 `&` 后是否显示非常量引用传递的参数的空格:\n```cpp \n\n swap(/* & first: */ str1, /* & last: */ str2);\n```", "c_cpp.configuration.loggingLevel.markdownDescription": "输出面板中日志记录的详细程度。从最不详细到最详细的级别顺序为: `None` < `Error` < `Warning` < `Information` < `Debug`。", "c_cpp.configuration.autoAddFileAssociations.markdownDescription": "控制当文件为 C/C++ 文件中导航操作的目标时,其是否自动添加到 `#files.associations#`。", "c_cpp.configuration.workspaceParsingPriority.markdownDescription": "控制分析非活动工作区文件是否使用睡眠以避免使用 100% CPU。值 `highest`/`high`/`medium`/`low` 对应于约 100/75/50/25% 的 CPU 使用率。", diff --git a/Extension/package.json b/Extension/package.json index d9899d136f..f65e1a3df2 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.11.3-main", + "version": "1.12.0-main", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md", @@ -11,7 +11,7 @@ }, "license": "SEE LICENSE IN LICENSE.txt", "engines": { - "vscode": "^1.65.0" + "vscode": "^1.67.0" }, "bugs": { "url": "https://github.com/Microsoft/vscode-cpptools/issues", @@ -2682,7 +2682,8 @@ "type": "object", "markdownDescription": "%c_cpp.configuration.filesExclude.markdownDescription%", "default": { - "**/.vscode": true + "**/.vscode": true, + "**/.vs": true }, "additionalProperties": { "anyOf": [ @@ -5434,7 +5435,7 @@ "tmp": "^0.2.1", "vscode-cpptools": "^6.1.0", "@vscode/extension-telemetry": "^0.6.2", - "vscode-languageclient": "^5.2.1", + "vscode-languageclient": "^8.0.1", "vscode-nls": "^5.0.0", "vscode-tas-client": "^0.1.27", "which": "^2.0.2", @@ -5452,6 +5453,7 @@ "set-value": "^4.0.1", "yargs-parser": "^15.0.1", "y18n": "^5.0.5", - "minimist": "^1.2.6" + "minimist": "^1.2.6", + "terser": "^5.14.2" } -} \ No newline at end of file +} diff --git a/Extension/src/LanguageServer/Providers/codeActionProvider.ts b/Extension/src/LanguageServer/Providers/codeActionProvider.ts index bc163f149e..dabfd81bc2 100644 --- a/Extension/src/LanguageServer/Providers/codeActionProvider.ts +++ b/Extension/src/LanguageServer/Providers/codeActionProvider.ts @@ -24,8 +24,8 @@ interface CodeActionCommand { uri?: string; } -export const GetCodeActionsRequest: RequestType = - new RequestType('cpptools/getCodeActions'); +export const GetCodeActionsRequest: RequestType = + new RequestType('cpptools/getCodeActions'); export class CodeActionProvider implements vscode.CodeActionProvider { private client: DefaultClient; diff --git a/Extension/src/LanguageServer/Providers/findAllReferencesProvider.ts b/Extension/src/LanguageServer/Providers/findAllReferencesProvider.ts index e4dc81ab21..403c080d67 100644 --- a/Extension/src/LanguageServer/Providers/findAllReferencesProvider.ts +++ b/Extension/src/LanguageServer/Providers/findAllReferencesProvider.ts @@ -73,7 +73,7 @@ export class FindAllReferencesProvider implements vscode.ReferenceProvider { // This is a preview (2nd or later preview) workspaceReferences.referencesRequestPending = true; workspaceReferences.setResultsCallback(resultCallback); - this.client.languageClient.sendNotification(RequestReferencesNotification, false); + this.client.languageClient.sendNotification(RequestReferencesNotification); } } token.onCancellationRequested(e => { diff --git a/Extension/src/LanguageServer/Providers/inlayHintProvider.ts b/Extension/src/LanguageServer/Providers/inlayHintProvider.ts index c79cb4f5ea..74f43a92ee 100644 --- a/Extension/src/LanguageServer/Providers/inlayHintProvider.ts +++ b/Extension/src/LanguageServer/Providers/inlayHintProvider.ts @@ -35,12 +35,12 @@ interface GetInlayHintsResult { type InlayHintsCacheEntry = { FileVersion: number; - TypeHints: vscode.InlayHint[]; + TypeHints: CppInlayHint[]; ParameterHints: CppInlayHint[]; }; -const GetInlayHintsRequest: RequestType = - new RequestType('cpptools/getInlayHints'); +const GetInlayHintsRequest: RequestType = + new RequestType('cpptools/getInlayHints'); export class InlayHintsProvider implements vscode.InlayHintsProvider { private client: DefaultClient; @@ -89,13 +89,33 @@ export class InlayHintsProvider implements vscode.InlayHintsProvider { let result: vscode.InlayHint[] = []; const settings: CppSettings = new CppSettings(); if (settings.inlayHintsAutoDeclarationTypes) { - result = result.concat(cacheEntry?.TypeHints); + const resolvedTypeHints: vscode.InlayHint[] = this.resolveTypeHints(cacheEntry.TypeHints); + result = result.concat(resolvedTypeHints); + } + if (settings.inlayHintsParameterNames || settings.inlayHintsReferenceOperator) { + const resolvedParameterHints: vscode.InlayHint[] = this.resolveParameterHints(cacheEntry.ParameterHints); + result = result.concat(resolvedParameterHints); } - const resolvedParameterHints: vscode.InlayHint[] = this.resolveParameterHints(cacheEntry.ParameterHints); - result = result.concat(resolvedParameterHints); return result; } + private resolveTypeHints(hints: CppInlayHint[]): vscode.InlayHint[] { + const resolvedHints: vscode.InlayHint[] = []; + const settings: CppSettings = new CppSettings(); + for (const hint of hints) { + const showOnLeft: boolean = settings.inlayHintsAutoDeclarationTypesShowOnLeft && hint.identifierLength > 0; + const inlayHint: vscode.InlayHint = new vscode.InlayHint( + new vscode.Position(hint.position.line, hint.position.character + + (showOnLeft ? 0 : hint.identifierLength)), + (showOnLeft ? hint.label : ": " + hint.label), + vscode.InlayHintKind.Type); + inlayHint.paddingRight = showOnLeft || hint.rightPadding; + inlayHint.paddingLeft = showOnLeft && hint.leftPadding; + resolvedHints.push(inlayHint); + } + return resolvedHints; + } + private resolveParameterHints(hints: CppInlayHint[]): vscode.InlayHint[] { const resolvedHints: vscode.InlayHint[] = []; const settings: CppSettings = new CppSettings(); @@ -119,16 +139,16 @@ export class InlayHintsProvider implements vscode.InlayHintsProvider { } let refOperatorString: string = ""; if (settings.inlayHintsReferenceOperator && hint.isValueRef) { - refOperatorString = (paramHintLabel.length > 0 && settings.inlayHintsReferenceOperatorShowSpace) ? "& " : "&"; + refOperatorString = (paramHintLabel !== "" && settings.inlayHintsReferenceOperatorShowSpace) ? "& " : "&"; } - let label: string = ""; - if (paramHintLabel.length > 0 || refOperatorString.length > 0) { - label = refOperatorString + paramHintLabel + ":"; + + if (paramHintLabel === "" && refOperatorString === "") { + continue; } const inlayHint: vscode.InlayHint = new vscode.InlayHint( new vscode.Position(hint.position.line, hint.position.character), - label, + refOperatorString + paramHintLabel + ":", vscode.InlayHintKind.Parameter); inlayHint.paddingRight = true; resolvedHints.push(inlayHint); @@ -137,21 +157,7 @@ export class InlayHintsProvider implements vscode.InlayHintsProvider { } private createCacheEntry(inlayHintsResults: GetInlayHintsResult): InlayHintsCacheEntry { - const typeHints: vscode.InlayHint[] = []; - const settings: CppSettings = new CppSettings(); - for (const h of inlayHintsResults.inlayHints) { - if (h.inlayHintKind === InlayHintKind.Type) { - const showOnLeft: boolean = settings.inlayHintsAutoDeclarationTypesShowOnLeft && h.identifierLength > 0; - const inlayHint: vscode.InlayHint = new vscode.InlayHint( - new vscode.Position(h.position.line, h.position.character + - (showOnLeft ? 0 : h.identifierLength)), - (showOnLeft ? h.label : ": " + h.label), - vscode.InlayHintKind.Type); - inlayHint.paddingRight = showOnLeft || h.rightPadding; - inlayHint.paddingLeft = showOnLeft && h.leftPadding; - typeHints.push(inlayHint); - } - } + const typeHints: CppInlayHint[] = inlayHintsResults.inlayHints.filter(h => h.inlayHintKind === InlayHintKind.Type); const paramHints: CppInlayHint[] = inlayHintsResults.inlayHints.filter(h => h.inlayHintKind === InlayHintKind.Parameter); const cacheEntry: InlayHintsCacheEntry = { FileVersion: inlayHintsResults.fileVersion, diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 2ce8f32bec..ea2b6ac80d 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -21,7 +21,8 @@ import { CodeActionProvider } from './Providers/codeActionProvider'; import { InlayHintsProvider } from './Providers/inlayHintProvider'; // End provider imports -import { LanguageClient, LanguageClientOptions, ServerOptions, NotificationType, TextDocumentIdentifier, RequestType, ErrorAction, CloseAction, DidOpenTextDocumentParams, Range, Position, DocumentFilter } from 'vscode-languageclient'; +import { LanguageClientOptions, NotificationType, TextDocumentIdentifier, RequestType, ErrorAction, CloseAction, DidOpenTextDocumentParams, Range, Position, DocumentFilter } from 'vscode-languageclient'; +import { LanguageClient, ServerOptions } from 'vscode-languageclient/node'; import { SourceFileConfigurationItem, WorkspaceBrowseConfiguration, SourceFileConfiguration, Version } from 'vscode-cpptools'; import { Status, IntelliSenseStatus } from 'vscode-cpptools/out/testApi'; import { getLocaleId, getLocalizedString, LocalizeStringParams } from './localization'; @@ -59,6 +60,7 @@ const configProviderTimeout: number = 2000; // Data shared by all clients. let languageClient: LanguageClient; +let firstClientStarted: Promise; let languageClientCrashedNeedsRestart: boolean = false; const languageClientCrashTimes: number[] = []; let clientCollection: ClientCollection; @@ -92,7 +94,7 @@ function setupOutputHandlers(): void { } /** Note: We should not await on the following functions, - * or any funstion that returns a promise acquired from them, + * or any function that returns a promise acquired from them, * vscode.window.showInformationMessage, vscode.window.showWarningMessage, vscode.window.showErrorMessage */ function showMessageWindow(params: ShowMessageWindowParams): void { @@ -411,6 +413,14 @@ enum CodeAnalysisScope { ClearSquiggles }; +interface CodeAnalysisParams { + scope: CodeAnalysisScope; +} + +interface FinishedRequestCustomConfigParams { + uri: string; +} + interface IntervalTimerParams { freeMemory: number; }; @@ -421,74 +431,74 @@ export interface TextDocumentWillSaveParams { } // Requests -const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); -const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); -const SwitchHeaderSourceRequest: RequestType = new RequestType('cpptools/didSwitchHeaderSource'); -const GetDiagnosticsRequest: RequestType = new RequestType('cpptools/getDiagnostics'); -export const GetDocumentSymbolRequest: RequestType = new RequestType('cpptools/getDocumentSymbols'); -export const GetSymbolInfoRequest: RequestType = new RequestType('cpptools/getWorkspaceSymbols'); -export const GetFoldingRangesRequest: RequestType = new RequestType('cpptools/getFoldingRanges'); -export const GetSemanticTokensRequest: RequestType = new RequestType('cpptools/getSemanticTokens'); -export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatDocument'); -export const FormatRangeRequest: RequestType = new RequestType('cpptools/formatRange'); -export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); -const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); +const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); +const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); +const SwitchHeaderSourceRequest: RequestType = new RequestType('cpptools/didSwitchHeaderSource'); +const GetDiagnosticsRequest: RequestType = new RequestType('cpptools/getDiagnostics'); +export const GetDocumentSymbolRequest: RequestType = new RequestType('cpptools/getDocumentSymbols'); +export const GetSymbolInfoRequest: RequestType = new RequestType('cpptools/getWorkspaceSymbols'); +export const GetFoldingRangesRequest: RequestType = new RequestType('cpptools/getFoldingRanges'); +export const GetSemanticTokensRequest: RequestType = new RequestType('cpptools/getSemanticTokens'); +export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatDocument'); +export const FormatRangeRequest: RequestType = new RequestType('cpptools/formatRange'); +export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); +const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); // Notifications to the server -const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); -const FileCreatedNotification: NotificationType = new NotificationType('cpptools/fileCreated'); -const FileChangedNotification: NotificationType = new NotificationType('cpptools/fileChanged'); -const FileDeletedNotification: NotificationType = new NotificationType('cpptools/fileDeleted'); -const ResetDatabaseNotification: NotificationType = new NotificationType('cpptools/resetDatabase'); -const PauseParsingNotification: NotificationType = new NotificationType('cpptools/pauseParsing'); -const ResumeParsingNotification: NotificationType = new NotificationType('cpptools/resumeParsing'); -const ActiveDocumentChangeNotification: NotificationType = new NotificationType('cpptools/activeDocumentChange'); -const RestartIntelliSenseForFileNotification: NotificationType = new NotificationType('cpptools/restartIntelliSenseForFile'); -const TextEditorSelectionChangeNotification: NotificationType = new NotificationType('cpptools/textEditorSelectionChange'); -const ChangeCppPropertiesNotification: NotificationType = new NotificationType('cpptools/didChangeCppProperties'); -const ChangeCompileCommandsNotification: NotificationType = new NotificationType('cpptools/didChangeCompileCommands'); -const ChangeSelectedSettingNotification: NotificationType = new NotificationType('cpptools/didChangeSelectedSetting'); -const IntervalTimerNotification: NotificationType = new NotificationType('cpptools/onIntervalTimer'); -const CustomConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomConfiguration'); -const CustomBrowseConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomBrowseConfiguration'); -const ClearCustomConfigurationsNotification: NotificationType = new NotificationType('cpptools/clearCustomConfigurations'); -const ClearCustomBrowseConfigurationNotification: NotificationType = new NotificationType('cpptools/clearCustomBrowseConfiguration'); -const RescanFolderNotification: NotificationType = new NotificationType('cpptools/rescanFolder'); -export const RequestReferencesNotification: NotificationType = new NotificationType('cpptools/requestReferences'); -export const CancelReferencesNotification: NotificationType = new NotificationType('cpptools/cancelReferences'); -const FinishedRequestCustomConfig: NotificationType = new NotificationType('cpptools/finishedRequestCustomConfig'); -const FindAllReferencesNotification: NotificationType = new NotificationType('cpptools/findAllReferences'); -const RenameNotification: NotificationType = new NotificationType('cpptools/rename'); -const DidChangeSettingsNotification: NotificationType = new NotificationType('cpptools/didChangeSettings'); - -const CodeAnalysisNotification: NotificationType = new NotificationType('cpptools/runCodeAnalysis'); -const PauseCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/pauseCodeAnalysis'); -const ResumeCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/resumeCodeAnalysis'); -const CancelCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/cancelCodeAnalysis'); -const RemoveCodeAnalysisProblemsNotification: NotificationType = new NotificationType('cpptools/removeCodeAnalysisProblems'); +const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); +const FileCreatedNotification: NotificationType = new NotificationType('cpptools/fileCreated'); +const FileChangedNotification: NotificationType = new NotificationType('cpptools/fileChanged'); +const FileDeletedNotification: NotificationType = new NotificationType('cpptools/fileDeleted'); +const ResetDatabaseNotification: NotificationType = new NotificationType('cpptools/resetDatabase'); +const PauseParsingNotification: NotificationType = new NotificationType('cpptools/pauseParsing'); +const ResumeParsingNotification: NotificationType = new NotificationType('cpptools/resumeParsing'); +const ActiveDocumentChangeNotification: NotificationType = new NotificationType('cpptools/activeDocumentChange'); +const RestartIntelliSenseForFileNotification: NotificationType = new NotificationType('cpptools/restartIntelliSenseForFile'); +const TextEditorSelectionChangeNotification: NotificationType = new NotificationType('cpptools/textEditorSelectionChange'); +const ChangeCppPropertiesNotification: NotificationType = new NotificationType('cpptools/didChangeCppProperties'); +const ChangeCompileCommandsNotification: NotificationType = new NotificationType('cpptools/didChangeCompileCommands'); +const ChangeSelectedSettingNotification: NotificationType = new NotificationType('cpptools/didChangeSelectedSetting'); +const IntervalTimerNotification: NotificationType = new NotificationType('cpptools/onIntervalTimer'); +const CustomConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomConfiguration'); +const CustomBrowseConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomBrowseConfiguration'); +const ClearCustomConfigurationsNotification: NotificationType = new NotificationType('cpptools/clearCustomConfigurations'); +const ClearCustomBrowseConfigurationNotification: NotificationType = new NotificationType('cpptools/clearCustomBrowseConfiguration'); +const RescanFolderNotification: NotificationType = new NotificationType('cpptools/rescanFolder'); +export const RequestReferencesNotification: NotificationType = new NotificationType('cpptools/requestReferences'); +export const CancelReferencesNotification: NotificationType = new NotificationType('cpptools/cancelReferences'); +const FinishedRequestCustomConfig: NotificationType = new NotificationType('cpptools/finishedRequestCustomConfig'); +const FindAllReferencesNotification: NotificationType = new NotificationType('cpptools/findAllReferences'); +const RenameNotification: NotificationType = new NotificationType('cpptools/rename'); +const DidChangeSettingsNotification: NotificationType = new NotificationType('cpptools/didChangeSettings'); + +const CodeAnalysisNotification: NotificationType = new NotificationType('cpptools/runCodeAnalysis'); +const PauseCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/pauseCodeAnalysis'); +const ResumeCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/resumeCodeAnalysis'); +const CancelCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/cancelCodeAnalysis'); +const RemoveCodeAnalysisProblemsNotification: NotificationType = new NotificationType('cpptools/removeCodeAnalysisProblems'); // Notifications from the server -const ReloadWindowNotification: NotificationType = new NotificationType('cpptools/reloadWindow'); -const LogTelemetryNotification: NotificationType = new NotificationType('cpptools/logTelemetry'); -const ReportTagParseStatusNotification: NotificationType = new NotificationType('cpptools/reportTagParseStatus'); -const ReportStatusNotification: NotificationType = new NotificationType('cpptools/reportStatus'); -const DebugProtocolNotification: NotificationType = new NotificationType('cpptools/debugProtocol'); -const DebugLogNotification: NotificationType = new NotificationType('cpptools/debugLog'); -const InactiveRegionNotification: NotificationType = new NotificationType('cpptools/inactiveRegions'); -const CompileCommandsPathsNotification: NotificationType = new NotificationType('cpptools/compileCommandsPaths'); -const ReferencesNotification: NotificationType = new NotificationType('cpptools/references'); -const ReportReferencesProgressNotification: NotificationType = new NotificationType('cpptools/reportReferencesProgress'); -const RequestCustomConfig: NotificationType = new NotificationType('cpptools/requestCustomConfig'); -const PublishIntelliSenseDiagnosticsNotification: NotificationType = new NotificationType('cpptools/publishIntelliSenseDiagnostics'); -const ShowMessageWindowNotification: NotificationType = new NotificationType('cpptools/showMessageWindow'); -const ShowWarningNotification: NotificationType = new NotificationType('cpptools/showWarning'); -const ReportTextDocumentLanguage: NotificationType = new NotificationType('cpptools/reportTextDocumentLanguage'); -const SemanticTokensChanged: NotificationType = new NotificationType('cpptools/semanticTokensChanged'); -const InlayHintsChanged: NotificationType = new NotificationType('cpptools/inlayHintsChanged'); -const IntelliSenseSetupNotification: NotificationType = new NotificationType('cpptools/IntelliSenseSetup'); -const SetTemporaryTextDocumentLanguageNotification: NotificationType = new NotificationType('cpptools/setTemporaryTextDocumentLanguage'); -const ReportCodeAnalysisProcessedNotification: NotificationType = new NotificationType('cpptools/reportCodeAnalysisProcessed'); -const ReportCodeAnalysisTotalNotification: NotificationType = new NotificationType('cpptools/reportCodeAnalysisTotal'); +const ReloadWindowNotification: NotificationType = new NotificationType('cpptools/reloadWindow'); +const LogTelemetryNotification: NotificationType = new NotificationType('cpptools/logTelemetry'); +const ReportTagParseStatusNotification: NotificationType = new NotificationType('cpptools/reportTagParseStatus'); +const ReportStatusNotification: NotificationType = new NotificationType('cpptools/reportStatus'); +const DebugProtocolNotification: NotificationType = new NotificationType('cpptools/debugProtocol'); +const DebugLogNotification: NotificationType = new NotificationType('cpptools/debugLog'); +const InactiveRegionNotification: NotificationType = new NotificationType('cpptools/inactiveRegions'); +const CompileCommandsPathsNotification: NotificationType = new NotificationType('cpptools/compileCommandsPaths'); +const ReferencesNotification: NotificationType = new NotificationType('cpptools/references'); +const ReportReferencesProgressNotification: NotificationType = new NotificationType('cpptools/reportReferencesProgress'); +const RequestCustomConfig: NotificationType = new NotificationType('cpptools/requestCustomConfig'); +const PublishIntelliSenseDiagnosticsNotification: NotificationType = new NotificationType('cpptools/publishIntelliSenseDiagnostics'); +const ShowMessageWindowNotification: NotificationType = new NotificationType('cpptools/showMessageWindow'); +const ShowWarningNotification: NotificationType = new NotificationType('cpptools/showWarning'); +const ReportTextDocumentLanguage: NotificationType = new NotificationType('cpptools/reportTextDocumentLanguage'); +const SemanticTokensChanged: NotificationType = new NotificationType('cpptools/semanticTokensChanged'); +const InlayHintsChanged: NotificationType = new NotificationType('cpptools/inlayHintsChanged'); +const IntelliSenseSetupNotification: NotificationType = new NotificationType('cpptools/IntelliSenseSetup'); +const SetTemporaryTextDocumentLanguageNotification: NotificationType = new NotificationType('cpptools/setTemporaryTextDocumentLanguage'); +const ReportCodeAnalysisProcessedNotification: NotificationType = new NotificationType('cpptools/reportCodeAnalysisProcessed'); +const ReportCodeAnalysisTotalNotification: NotificationType = new NotificationType('cpptools/reportCodeAnalysisTotal'); let failureMessageShown: boolean = false; export interface ReferencesCancellationState { @@ -613,7 +623,7 @@ export interface Client { queueTask(task: () => Thenable): Promise; requestWhenReady(request: () => Thenable): Thenable; notifyWhenLanguageClientReady(notify: () => void): void; - awaitUntilLanguageClientReady(): void; + awaitUntilLanguageClientReady(): Thenable; requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable; activeDocumentChanged(document: vscode.TextDocument): Promise; restartIntelliSenseForFile(document: vscode.TextDocument): Promise; @@ -803,7 +813,7 @@ export class DefaultClient implements Client { languageClient = this.createLanguageClient(allClients); clientCollection = allClients; languageClient.registerProposedFeatures(); - languageClient.start(); // This returns Disposable, but doesn't need to be tracked because we call .stop() explicitly in our dispose() + firstClientStarted = languageClient.start(); util.setProgress(util.getProgressExecutableStarted()); firstClient = true; } @@ -812,7 +822,7 @@ export class DefaultClient implements Client { // requests/notifications are deferred until this.languageClient is set. this.queueBlockingTask(async () => { - await languageClient.onReady(); + await firstClientStarted; try { const workspaceFolder: vscode.WorkspaceFolder | undefined = this.rootFolder; this.innerConfiguration = new configs.CppProperties(rootUri, workspaceFolder); @@ -911,7 +921,7 @@ export class DefaultClient implements Client { this.languageClient.sendNotification(FindAllReferencesNotification, params); } - public sendRenameNofication(params: RenameParams): void { + public sendRenameNotification(params: RenameParams): void { this.languageClient.sendNotification(RenameNotification, params); } @@ -1334,7 +1344,7 @@ export class DefaultClient implements Client { }, middleware: createProtocolFilter(allClients), errorHandler: { - error: () => ErrorAction.Continue, + error: (error, message, count) => ({ action: ErrorAction.Continue }), closed: () => { languageClientCrashTimes.push(Date.now()); languageClientCrashedNeedsRestart = true; @@ -1351,7 +1361,7 @@ export class DefaultClient implements Client { allClients.recreateClients(); } } - return CloseAction.DoNotRestart; + return { action: CloseAction.DoNotRestart }; } } @@ -1804,7 +1814,7 @@ export class DefaultClient implements Client { public async provideCustomConfiguration(docUri: vscode.Uri, requestFile?: string, replaceExisting?: boolean): Promise { const onFinished: () => void = () => { if (requestFile) { - this.languageClient.sendNotification(FinishedRequestCustomConfig, requestFile); + this.languageClient.sendNotification(FinishedRequestCustomConfig, { uri: requestFile }); } }; const providerId: string | undefined = this.configurationProvider; @@ -2996,23 +3006,23 @@ export class DefaultClient implements Client { public async handleRunCodeAnalysisOnActiveFile(): Promise { await this.awaitUntilLanguageClientReady(); - this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.ActiveFile); + this.languageClient.sendNotification(CodeAnalysisNotification, { scope: CodeAnalysisScope.ActiveFile }); } public async handleRunCodeAnalysisOnOpenFiles(): Promise { await this.awaitUntilLanguageClientReady(); - this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.OpenFiles); + this.languageClient.sendNotification(CodeAnalysisNotification, { scope: CodeAnalysisScope.OpenFiles }); } public async handleRunCodeAnalysisOnAllFiles(): Promise { await this.awaitUntilLanguageClientReady(); - this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.AllFiles); + this.languageClient.sendNotification(CodeAnalysisNotification, { scope: CodeAnalysisScope.AllFiles }); } public async handleRemoveAllCodeAnalysisProblems(): Promise { await this.awaitUntilLanguageClientReady(); if (removeAllCodeAnalysisProblems()) { - this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.ClearSquiggles); + this.languageClient.sendNotification(CodeAnalysisNotification, { scope: CodeAnalysisScope.ClearSquiggles }); } } @@ -3109,7 +3119,7 @@ export class DefaultClient implements Client { } else { workspaceReferences.referencesRequestHasOccurred = true; workspaceReferences.referencesRequestPending = true; - this.languageClient.sendNotification(RequestReferencesNotification, false); + this.languageClient.sendNotification(RequestReferencesNotification); } } } @@ -3203,7 +3213,7 @@ class NullClient implements Client { queueTask(task: () => Thenable): Promise { return Promise.resolve(task()); } requestWhenReady(request: () => Thenable): Thenable { return request(); } notifyWhenLanguageClientReady(notify: () => void): void { } - awaitUntilLanguageClientReady(): void { } + awaitUntilLanguageClientReady(): Thenable { return Promise.resolve(); } requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable { return Promise.resolve(""); } activeDocumentChanged(document: vscode.TextDocument): Promise { return Promise.resolve(); } restartIntelliSenseForFile(document: vscode.TextDocument): Promise { return Promise.resolve(); } diff --git a/Extension/src/LanguageServer/codeAnalysis.ts b/Extension/src/LanguageServer/codeAnalysis.ts index c161bc8a5d..a55c9f55a7 100644 --- a/Extension/src/LanguageServer/codeAnalysis.ts +++ b/Extension/src/LanguageServer/codeAnalysis.ts @@ -4,7 +4,7 @@ * ------------------------------------------------------------------------------------------ */ 'use strict'; import * as vscode from 'vscode'; -import { LanguageClient, NotificationType, Range } from 'vscode-languageclient'; +import { LanguageClient, NotificationType, Range } from 'vscode-languageclient/node'; import { Location, WorkspaceEdit } from './commonTypes'; import { makeVscodeRange, makeVscodeLocation, makeVscodeTextEdits, rangeEquals } from './utils'; import {LocalizeStringParams, getLocalizedString } from './localization'; @@ -110,8 +110,8 @@ interface PublishCodeAnalysisDiagnosticsParams { diagnostics: CodeAnalysisDiagnostic[]; } -const PublishCodeAnalysisDiagnosticsNotification: NotificationType = new NotificationType('cpptools/publishCodeAnalysisDiagnostics'); -const PublishRemoveCodeAnalysisCodeActionFixesNotification: NotificationType = new NotificationType('cpptools/publishRemoveCodeAnalysisCodeActionFixes'); +const PublishCodeAnalysisDiagnosticsNotification: NotificationType = new NotificationType('cpptools/publishCodeAnalysisDiagnostics'); +const PublishRemoveCodeAnalysisCodeActionFixesNotification: NotificationType = new NotificationType('cpptools/publishRemoveCodeAnalysisCodeActionFixes'); export const codeAnalysisFileToCodeActions: Map = new Map(); export const codeAnalysisCodeToFixes: Map = new Map(); diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 9118ab0899..7ad3b226f4 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -38,6 +38,7 @@ let clients: ClientCollection; let activeDocument: string; let ui: UI; const disposables: vscode.Disposable[] = []; +const commandDisposables: vscode.Disposable[] = []; let languageConfigurations: vscode.Disposable[] = []; let intervalTimer: NodeJS.Timer; let codeActionProvider: vscode.Disposable; @@ -198,7 +199,7 @@ export async function activate(): Promise { intervalTimer = global.setInterval(onInterval, 2500); }); - registerCommands(); + registerCommands(true); vscode.tasks.onDidStartTask(event => { getActiveClient().PauseCodeAnalysis(); @@ -383,53 +384,67 @@ function onInterval(): void { /** * registered commands */ -export function registerCommands(): void { - disposables.push(vscode.commands.registerCommand('C_Cpp.SwitchHeaderSource', onSwitchHeaderSource)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ResetDatabase', onResetDatabase)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationSelect', onSelectConfiguration)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationProviderSelect', onSelectConfigurationProvider)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEditJSON', onEditConfigurationJSON)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEditUI', onEditConfigurationUI)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEdit', onEditConfiguration)); - disposables.push(vscode.commands.registerCommand('C_Cpp.AddToIncludePath', onAddToIncludePath)); - disposables.push(vscode.commands.registerCommand('C_Cpp.EnableErrorSquiggles', onEnableSquiggles)); - disposables.push(vscode.commands.registerCommand('C_Cpp.DisableErrorSquiggles', onDisableSquiggles)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleIncludeFallback', onToggleIncludeFallback)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleDimInactiveRegions', onToggleDimInactiveRegions)); - disposables.push(vscode.commands.registerCommand('C_Cpp.PauseParsing', onPauseParsing)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ResumeParsing', onResumeParsing)); - disposables.push(vscode.commands.registerCommand('C_Cpp.PauseCodeAnalysis', onPauseCodeAnalysis)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ResumeCodeAnalysis', onResumeCodeAnalysis)); - disposables.push(vscode.commands.registerCommand('C_Cpp.CancelCodeAnalysis', onCancelCodeAnalysis)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommands', onShowParsingCommands)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ShowCodeAnalysisCommands', onShowCodeAnalysisCommands)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgress', onShowReferencesProgress)); - disposables.push(vscode.commands.registerCommand('C_Cpp.TakeSurvey', onTakeSurvey)); - disposables.push(vscode.commands.registerCommand('C_Cpp.LogDiagnostics', onLogDiagnostics)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RescanWorkspace', onRescanWorkspace)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferenceItem', onShowRefCommand)); - disposables.push(vscode.commands.registerCommand('C_Cpp.referencesViewGroupByType', onToggleRefGroupView)); - disposables.push(vscode.commands.registerCommand('C_Cpp.referencesViewUngroupByType', onToggleRefGroupView)); - disposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgClipboardInstallSuggested', onVcpkgClipboardInstallSuggested)); - disposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgOnlineHelpSuggested', onVcpkgOnlineHelpSuggested)); - disposables.push(vscode.commands.registerCommand('C_Cpp.GenerateEditorConfig', onGenerateEditorConfig)); - disposables.push(vscode.commands.registerCommand('C_Cpp.GoToNextDirectiveInGroup', onGoToNextDirectiveInGroup)); - disposables.push(vscode.commands.registerCommand('C_Cpp.GoToPrevDirectiveInGroup', onGoToPrevDirectiveInGroup)); - disposables.push(vscode.commands.registerCommand('C_Cpp.CheckForCompiler', onCheckForCompiler)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnActiveFile', onRunCodeAnalysisOnActiveFile)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnOpenFiles', onRunCodeAnalysisOnOpenFiles)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnAllFiles', onRunCodeAnalysisOnAllFiles)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RemoveCodeAnalysisProblems', onRemoveCodeAnalysisProblems)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RemoveAllCodeAnalysisProblems', onRemoveAllCodeAnalysisProblems)); - disposables.push(vscode.commands.registerCommand('C_Cpp.FixThisCodeAnalysisProblem', onFixThisCodeAnalysisProblem)); - disposables.push(vscode.commands.registerCommand('C_Cpp.FixAllTypeCodeAnalysisProblems', onFixAllTypeCodeAnalysisProblems)); - disposables.push(vscode.commands.registerCommand('C_Cpp.FixAllCodeAnalysisProblems', onFixAllCodeAnalysisProblems)); - disposables.push(vscode.commands.registerCommand('C_Cpp.DisableAllTypeCodeAnalysisProblems', onDisableAllTypeCodeAnalysisProblems)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ShowCodeAnalysisDocumentation', (uri) => vscode.env.openExternal(uri))); - disposables.push(vscode.commands.registerCommand('cpptools.activeConfigName', onGetActiveConfigName)); - disposables.push(vscode.commands.registerCommand('cpptools.activeConfigCustomVariable', onGetActiveConfigCustomVariable)); - disposables.push(vscode.commands.registerCommand('cpptools.setActiveConfigName', onSetActiveConfigName)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RestartIntelliSenseForFile', onRestartIntelliSenseForFile)); +export function registerCommands(enabled: boolean): void { + commandDisposables.forEach(d => d.dispose()); + commandDisposables.length = 0; + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SwitchHeaderSource', enabled ? onSwitchHeaderSource : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ResetDatabase', enabled ? onResetDatabase : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationSelect', enabled ? onSelectConfiguration : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationProviderSelect', enabled ? onSelectConfigurationProvider : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEditJSON', enabled ? onEditConfigurationJSON : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEditUI', enabled ? onEditConfigurationUI : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEdit', enabled ? onEditConfiguration : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.AddToIncludePath', enabled ? onAddToIncludePath : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.EnableErrorSquiggles', enabled ? onEnableSquiggles : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.DisableErrorSquiggles', enabled ? onDisableSquiggles : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ToggleIncludeFallback', enabled ? onToggleIncludeFallback : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ToggleDimInactiveRegions', enabled ? onToggleDimInactiveRegions : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.PauseParsing', enabled ? onPauseParsing : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ResumeParsing', enabled ? onResumeParsing : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.PauseCodeAnalysis', enabled ? onPauseCodeAnalysis : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ResumeCodeAnalysis', enabled ? onResumeCodeAnalysis : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.CancelCodeAnalysis', enabled ? onCancelCodeAnalysis : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommands', enabled ? onShowParsingCommands : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCodeAnalysisCommands', enabled ? onShowCodeAnalysisCommands : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgress', enabled ? onShowReferencesProgress : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.TakeSurvey', enabled ? onTakeSurvey : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.LogDiagnostics', enabled ? onLogDiagnostics : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RescanWorkspace', enabled ? onRescanWorkspace : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferenceItem', enabled ? onShowRefCommand : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.referencesViewGroupByType', enabled ? onToggleRefGroupView : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.referencesViewUngroupByType', enabled ? onToggleRefGroupView : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgClipboardInstallSuggested', enabled ? onVcpkgClipboardInstallSuggested : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgOnlineHelpSuggested', enabled ? onVcpkgOnlineHelpSuggested : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.GenerateEditorConfig', enabled ? onGenerateEditorConfig : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.GoToNextDirectiveInGroup', enabled ? onGoToNextDirectiveInGroup : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.GoToPrevDirectiveInGroup', enabled ? onGoToPrevDirectiveInGroup : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.CheckForCompiler', enabled ? onCheckForCompiler : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnActiveFile', enabled ? onRunCodeAnalysisOnActiveFile : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnOpenFiles', enabled ? onRunCodeAnalysisOnOpenFiles : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnAllFiles', enabled ? onRunCodeAnalysisOnAllFiles : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RemoveCodeAnalysisProblems', enabled ? onRemoveCodeAnalysisProblems : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RemoveAllCodeAnalysisProblems', enabled ? onRemoveAllCodeAnalysisProblems : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.FixThisCodeAnalysisProblem', enabled ? onFixThisCodeAnalysisProblem : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.FixAllTypeCodeAnalysisProblems', enabled ? onFixAllTypeCodeAnalysisProblems : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.FixAllCodeAnalysisProblems', enabled ? onFixAllCodeAnalysisProblems : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.DisableAllTypeCodeAnalysisProblems', enabled ? onDisableAllTypeCodeAnalysisProblems : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCodeAnalysisDocumentation', enabled ? (uri) => vscode.env.openExternal(uri) : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('cpptools.activeConfigName', enabled ? onGetActiveConfigName : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('cpptools.activeConfigCustomVariable', enabled ? onGetActiveConfigCustomVariable : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('cpptools.setActiveConfigName', enabled ? onSetActiveConfigName : onDisabledCommand)); + commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RestartIntelliSenseForFile', enabled ? onRestartIntelliSenseForFile : onDisabledCommand)); +} + +function onDisabledCommand(): void { + const message: string = localize( + { + key: "on.disabled.command", + comment: [ + "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." + ] + }, + "IntelliSense-related commands cannot be executed when `C_Cpp.intelliSenseEngine` is set to `Disabled`."); + vscode.window.showWarningMessage(message); } function onRestartIntelliSenseForFile(): void { @@ -986,6 +1001,7 @@ export function deactivate(): Thenable { console.log("deactivating extension"); telemetry.logLanguageServerEvent("LanguageServerShutdown"); clearInterval(intervalTimer); + commandDisposables.forEach(d => d.dispose()); disposables.forEach(d => d.dispose()); languageConfigurations.forEach(d => d.dispose()); ui.dispose(); diff --git a/Extension/src/LanguageServer/protocolFilter.ts b/Extension/src/LanguageServer/protocolFilter.ts index 9093d45464..2c5d357bcd 100644 --- a/Extension/src/LanguageServer/protocolFilter.ts +++ b/Extension/src/LanguageServer/protocolFilter.ts @@ -14,16 +14,16 @@ import { onDidChangeActiveTextEditor, processDelayedDidOpen } from './extension' export function createProtocolFilter(clients: ClientCollection): Middleware { // Disabling lint for invoke handlers - const defaultHandler: (data: any, callback: (data: any) => void) => void = (data, callback: (data: any) => void) => { clients.ActiveClient.notifyWhenLanguageClientReady(() => callback(data)); }; - // let invoke1 = (a, callback: (a) => any) => { if (clients.ActiveClient === me) { return me.requestWhenReady(() => callback(a)); } return null; }; - const invoke2 = (a: any, b: any, callback: (a: any, b: any) => any) => clients.ActiveClient.requestWhenReady(() => callback(a, b)); - const invoke3 = (a: any, b: any, c: any, callback: (a: any, b: any, c: any) => any) => clients.ActiveClient.requestWhenReady(() => callback(a, b, c)); - const invoke4 = (a: any, b: any, c: any, d: any, callback: (a: any, b: any, c: any, d: any) => any) => clients.ActiveClient.requestWhenReady(() => callback(a, b, c, d)); - const invoke5 = (a: any, b: any, c: any, d: any, e: any, callback: (a: any, b: any, c: any, d: any, e: any) => any) => clients.ActiveClient.requestWhenReady(() => callback(a, b, c, d, e)); + const defaultHandler: (data: any, callback: (data: any) => Promise) => Promise = async (data, callback: (data: any) => void) => { clients.ActiveClient.notifyWhenLanguageClientReady(() => callback(data)); }; + // const invoke1 = async (a: any, next: (a: any) => any) => { await clients.ActiveClient.awaitUntilLanguageClientReady(); return next(a); }; + const invoke2 = async (a: any, b: any, next: (a: any, b: any) => any) => { await clients.ActiveClient.awaitUntilLanguageClientReady(); return next(a, b); }; + const invoke3 = async (a: any, b: any, c: any, next: (a: any, b: any, c: any) => any) => { await clients.ActiveClient.awaitUntilLanguageClientReady(); return next(a, b, c); }; + const invoke4 = async (a: any, b: any, c: any, d: any, next: (a: any, b: any, c: any, d: any) => any) => { await clients.ActiveClient.awaitUntilLanguageClientReady(); return next(a, b, c, d); }; + // const invoke5 = async (a: any, b: any, c: any, d: any, e: any, next: (a: any, b: any, c: any, d: any, e: any) => any) => { await clients.ActiveClient.awaitUntilLanguageClientReady(); return next(a, b, c, d, e); }; /* tslint:enable */ return { - didOpen: (document, sendMessage) => { + didOpen: async (document, sendMessage) => { const editor: vscode.TextEditor | undefined = vscode.window.visibleTextEditors.find(e => e.document === document); if (editor) { // If the file was visible editor when we were activated, we will not get a call to @@ -74,7 +74,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware { // didOpen), and first becomes visible. } }, - didChange: (textDocumentChangeEvent, sendMessage) => { + didChange: async (textDocumentChangeEvent, sendMessage) => { const me: Client = clients.getClientFor(textDocumentChangeEvent.document.uri); if (!me.TrackedDocuments.has(textDocumentChangeEvent.document)) { processDelayedDidOpen(textDocumentChangeEvent.document); @@ -83,7 +83,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware { me.notifyWhenLanguageClientReady(() => sendMessage(textDocumentChangeEvent)); }, willSave: defaultHandler, - willSaveWaitUntil: (event, sendMessage) => { + willSaveWaitUntil: async (event, sendMessage) => { const me: Client = clients.getClientFor(event.document.uri); if (me.TrackedDocuments.has(event.document)) { // Don't use me.requestWhenReady or notifyWhenLanguageClientReady; @@ -93,7 +93,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware { return Promise.resolve([]); }, didSave: defaultHandler, - didClose: (document, sendMessage) => { + didClose: async (document, sendMessage) => { const me: Client = clients.getClientFor(document.uri); if (me.TrackedDocuments.has(document)) { me.onDidCloseTextDocument(document); @@ -111,23 +111,11 @@ export function createProtocolFilter(clients: ClientCollection): Middleware { } return null; }, - provideSignatureHelp: invoke3, + provideSignatureHelp: invoke4, provideDefinition: invoke3, provideReferences: invoke4, provideDocumentHighlights: invoke3, - provideDocumentSymbols: invoke2, - provideWorkspaceSymbols: invoke2, - provideCodeActions: invoke4, - provideCodeLenses: invoke2, - resolveCodeLens: invoke2, - provideDocumentFormattingEdits: invoke3, - provideDocumentRangeFormattingEdits: invoke4, - provideOnTypeFormattingEdits: invoke5, - provideRenameEdits: invoke4, - provideDocumentLinks: invoke2, - resolveDocumentLink: invoke2, provideDeclaration: invoke3 - // I believe the default handler will do the same thing. // workspace: { // didChangeConfiguration: (sections, sendMessage) => sendMessage(sections) diff --git a/Extension/src/LanguageServer/references.ts b/Extension/src/LanguageServer/references.ts index c638bbe32a..b3cfd5003b 100644 --- a/Extension/src/LanguageServer/references.ts +++ b/Extension/src/LanguageServer/references.ts @@ -195,7 +195,7 @@ export class ReferencesManager { private prevVisibleRangesLength: number = 0; private visibleRangesDecreased: boolean = false; private visibleRangesDecreasedTicks: number = 0; - private readonly ticksForDetectingPeek: number = 1000; // TODO: Might need tweeking? + private readonly ticksForDetectingPeek: number = 1000; // TODO: Might need tweaking? private resultsCallback?: ReferencesResultCallback; private currentUpdateProgressTimer?: NodeJS.Timeout; @@ -397,7 +397,7 @@ export class ReferencesManager { this.resultsCallback(null, true); } } else { - this.client.sendRenameNofication(params); + this.client.sendRenameNotification(params); } } diff --git a/Extension/src/LanguageServer/referencesModel.ts b/Extension/src/LanguageServer/referencesModel.ts index 237f1094c3..a9aae90b28 100644 --- a/Extension/src/LanguageServer/referencesModel.ts +++ b/Extension/src/LanguageServer/referencesModel.ts @@ -141,7 +141,7 @@ export enum NodeType { referenceType, // A node to group reference types. file, // File node that has reference nodes. fileWithPendingRef, // File node with pending references to find (e.g. it has no reference children yet). - reference // A reference node, which is either a string, comment, inactice reference, etc. + reference // A reference node, which is either a string, comment, inactive reference, etc. } export class TreeNode { diff --git a/Extension/src/LanguageServer/referencesTreeDataProvider.ts b/Extension/src/LanguageServer/referencesTreeDataProvider.ts index 2dd5b90463..1243bc3b5d 100644 --- a/Extension/src/LanguageServer/referencesTreeDataProvider.ts +++ b/Extension/src/LanguageServer/referencesTreeDataProvider.ts @@ -40,7 +40,7 @@ export class ReferencesTreeDataProvider implements vscode.TreeDataProvider { + await testHelpers.activateCppExtension(); + + const cpptools = await apit.getCppToolsTestApi(api.Version.latest); + if (!cpptools) { + return; + } + const testHook: apit.CppToolsTestHook = cpptools.getTestHook(); + disposables.push(testHook); + + getIntelliSenseStatus = new Promise((resolve, reject) => { + disposables.push(testHook.IntelliSenseStatusChanged(result => { + result = result as apit.IntelliSenseStatus; + if (result.filename === "inlay_hints.cpp" && result.status === apit.Status.IntelliSenseReady) { + resolve(); + } + })); + setTimeout(() => { reject(new Error("Timeout: IntelliSenseStatusChanged event")); }, testHelpers.defaultTimeout); + }); + + // Start language server + console.log("Open file: " + fileUri.toString()); + const document: vscode.TextDocument = await vscode.workspace.openTextDocument(fileUri); + await vscode.window.showTextDocument(document) + await getIntelliSenseStatus; + saveOriginalSettings(); + await useDefaultSettings(); + }); + + suiteTeardown(async function(): Promise { + await restoreOriginalSettings(); + disposables.forEach(d => d.dispose()); + }); + + function saveOriginalSettings(): void { + autoDeclarationTypesEnabledValue = inlayHintSettings.inspect(autoDeclarationTypesEnabled).globalValue; + autoDeclarationTypesShowOnLeftValue = inlayHintSettings.inspect(autoDeclarationTypesShowOnLeft).globalValue; + parameterNamesEnabledValue = inlayHintSettings.inspect(parameterNamesEnabled).globalValue; + parameterNamesSuppressValue = inlayHintSettings.inspect(parameterNamesSuppress).globalValue; + parameterNamesHideUnderScoreValue = inlayHintSettings.inspect(parameterNamesHideUnderScore).globalValue; + referenceOperatorEnabledValue = inlayHintSettings.inspect(referenceOperatorEnabled).globalValue; + referenceOperatorShowSpaceValue = inlayHintSettings.inspect(referenceOperatorShowSpace).globalValue; + } + + async function restoreOriginalSettings(): Promise { + await changeInlayHintSetting(autoDeclarationTypesEnabled, autoDeclarationTypesEnabledValue); + await changeInlayHintSetting(autoDeclarationTypesShowOnLeft, autoDeclarationTypesShowOnLeftValue); + await changeInlayHintSetting(parameterNamesEnabled, parameterNamesEnabledValue); + await changeInlayHintSetting(parameterNamesSuppress, parameterNamesSuppressValue); + await changeInlayHintSetting(parameterNamesHideUnderScore, parameterNamesHideUnderScoreValue); + await changeInlayHintSetting(referenceOperatorEnabled, referenceOperatorEnabledValue); + await changeInlayHintSetting(referenceOperatorShowSpace, referenceOperatorShowSpaceValue); + } + + async function useDefaultSettings(): Promise { + await changeInlayHintSetting(autoDeclarationTypesEnabled, undefined); + await changeInlayHintSetting(autoDeclarationTypesShowOnLeft, undefined); + await changeInlayHintSetting(parameterNamesEnabled, undefined); + await changeInlayHintSetting(parameterNamesSuppress, undefined); + await changeInlayHintSetting(parameterNamesHideUnderScore, undefined); + await changeInlayHintSetting(referenceOperatorEnabled, undefined); + await changeInlayHintSetting(referenceOperatorShowSpace, undefined); + } + + test("[Inlay Hints - auto type]", async () => { + const range: vscode.Range = new vscode.Range(new vscode.Position(15, 0), new vscode.Position(31, 0)); + + await changeInlayHintSetting(autoDeclarationTypesEnabled, disabled); + await changeInlayHintSetting(autoDeclarationTypesShowOnLeft, disabled); + await getIntelliSenseStatus; + const result1 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result1.length, 0, "Incorrect number of results."); + + await changeInlayHintSetting(autoDeclarationTypesEnabled, enabled); + await getIntelliSenseStatus; + const result2 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result2.length, 12, "Incorrect number of results."); + const expectedKind = vscode.InlayHintKind.Type; + assertHintValues(result2, 0, 16, 16, ": int *const", expectedKind); + assertHintValues(result2, 1, 17, 17, ": const int *const", expectedKind); + assertHintValues(result2, 2, 18, 18, ": const int *const &", expectedKind); + assertHintValues(result2, 3, 19, 19, ": const int *const", expectedKind); + assertHintValues(result2, 4, 20, 17, ": const int", expectedKind); + assertHintValues(result2, 5, 21, 12, ": const int &", expectedKind); + assertHintValues(result2, 6, 22, 21, ": const int &", expectedKind); + assertHintValues(result2, 7, 23, 21, ": const int *", expectedKind); + assertHintValues(result2, 8, 24, 21, ": int *", expectedKind); + assertHintValues(result2, 9, 25, 21, ": const int *", expectedKind); + assertHintValues(result2, 10, 28, 14, ": int", expectedKind); + assertHintValues(result2, 11, 29, 15, ": int", expectedKind); + }); + + test("[Inlay Hints - auto type, show on left]", async () => { + const range: vscode.Range = new vscode.Range(new vscode.Position(15, 0), new vscode.Position(31, 0)); + + await changeInlayHintSetting(autoDeclarationTypesEnabled, disabled); + await changeInlayHintSetting(autoDeclarationTypesShowOnLeft, disabled); + await getIntelliSenseStatus; + const result1 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result1.length, 0, "Incorrect number of results."); + + await changeInlayHintSetting(autoDeclarationTypesEnabled, enabled); + await changeInlayHintSetting(autoDeclarationTypesShowOnLeft, enabled); + await getIntelliSenseStatus; + const result2 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result2.length, 12, "Incorrect number of results."); + const expectedKind = vscode.InlayHintKind.Type; + assertHintValues(result2, 0, 16, 15, "int *const", expectedKind); + assertHintValues(result2, 1, 17, 15, "const int *const", expectedKind); + assertHintValues(result2, 2, 18, 16, "const int *const &", expectedKind); + assertHintValues(result2, 3, 19, 17, "const int *const", expectedKind); + assertHintValues(result2, 4, 20, 15, "const int", expectedKind); + assertHintValues(result2, 5, 21, 10, "const int &", expectedKind); + assertHintValues(result2, 6, 22, 19, "const int &", expectedKind); + assertHintValues(result2, 7, 23, 19, "const int *", expectedKind); + assertHintValues(result2, 8, 24, 19, "int *", expectedKind); + assertHintValues(result2, 9, 25, 19, "const int *", expectedKind); + assertHintValues(result2, 10, 28, 9, "int", expectedKind); + assertHintValues(result2, 11, 29, 14, "int", expectedKind); + }); + + test("[Inlay Hints - parameter names]", async () => { + const range: vscode.Range = new vscode.Range(new vscode.Position(39, 0), new vscode.Position(78, 0)); + + await changeInlayHintSetting(parameterNamesEnabled, disabled); + await changeInlayHintSetting(referenceOperatorEnabled, disabled); + await getIntelliSenseStatus; + const result1 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result1.length, 0, "Incorrect number of results."); + + await changeInlayHintSetting(parameterNamesEnabled, enabled); + await changeInlayHintSetting(parameterNamesSuppress, enabled); + await getIntelliSenseStatus; + const result2 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result2.length, 16, "Incorrect number of results."); + const expectedKind = vscode.InlayHintKind.Parameter; + assertHintValues(result2, 0, 41, 17, "width:", expectedKind); + assertHintValues(result2, 1, 41, 20, "height:", expectedKind); + assertHintValues(result2, 2, 42, 17, "width:", expectedKind); + assertHintValues(result2, 3, 43, 17, "height:", expectedKind); + assertHintValues(result2, 4, 45, 17, "width:", expectedKind); + assertHintValues(result2, 5, 46, 17, "height:", expectedKind); + assertHintValues(result2, 6, 50, 20, "height:", expectedKind); + assertHintValues(result2, 7, 51, 26, "height:", expectedKind); + assertHintValues(result2, 8, 52, 29, "height:", expectedKind); + assertHintValues(result2, 9, 54, 13, "height:", expectedKind); + assertHintValues(result2, 10, 57, 13, "height:", expectedKind); + assertHintValues(result2, 11, 61, 13, "width:", expectedKind); + assertHintValues(result2, 12, 62, 13, "width:", expectedKind); + assertHintValues(result2, 13, 63, 16, "width:", expectedKind); + assertHintValues(result2, 14, 64, 13, "width:", expectedKind); + assertHintValues(result2, 15, 67, 13, "width:", expectedKind); + }); + + test("[Inlay Hints - parameter hideLeadingUnderscores]", async () => { + const range: vscode.Range = new vscode.Range(new vscode.Position(34, 0), new vscode.Position(36, 0)); + + await changeInlayHintSetting(parameterNamesEnabled, enabled); + await changeInlayHintSetting(parameterNamesHideUnderScore, disabled); + await getIntelliSenseStatus; + const result1 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result1.length, 4, "Incorrect number of results."); + const expectedKind = vscode.InlayHintKind.Parameter; + assertHintValues(result1, 0, 35, 16, "___x:", expectedKind); + assertHintValues(result1, 1, 35, 19, "__y:", expectedKind); + assertHintValues(result1, 2, 35, 22, "_z:", expectedKind); + assertHintValues(result1, 3, 35, 25, "a:", expectedKind); + + await changeInlayHintSetting(parameterNamesHideUnderScore, enabled); + await getIntelliSenseStatus; + const result2 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result2.length, 4, "Incorrect number of results."); + assertHintValues(result2, 0, 35, 16, "x:", expectedKind); + assertHintValues(result2, 1, 35, 19, "y:", expectedKind); + assertHintValues(result2, 2, 35, 22, "z:", expectedKind); + assertHintValues(result2, 3, 35, 25, "a:", expectedKind); + }); + + test("[Inlay Hints - reference operator]", async () => { + const range: vscode.Range = new vscode.Range(new vscode.Position(81, 0), new vscode.Position(106, 0)); + + await changeInlayHintSetting(parameterNamesEnabled, disabled); + await changeInlayHintSetting(referenceOperatorEnabled, disabled); + await changeInlayHintSetting(referenceOperatorShowSpace, disabled); + await getIntelliSenseStatus; + const result1 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result1.length, 0, "Incorrect number of results."); + + await changeInlayHintSetting(referenceOperatorEnabled, enabled); + await getIntelliSenseStatus; + const result2 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result2.length, 16, "Incorrect number of results."); + const expectedKind = vscode.InlayHintKind.Parameter; + const refOp: string = "&:"; + assertHintValues(result2, 0, 87, 9, refOp, expectedKind); + assertHintValues(result2, 1, 87, 12, refOp, expectedKind); + assertHintValues(result2, 2, 88, 9, refOp, expectedKind); + assertHintValues(result2, 3, 88, 22, refOp, expectedKind); + assertHintValues(result2, 4, 89, 9, refOp, expectedKind); + assertHintValues(result2, 5, 90, 9, refOp, expectedKind); + assertHintValues(result2, 6, 93, 9, refOp, expectedKind); + assertHintValues(result2, 7, 94, 9, refOp, expectedKind); + assertHintValues(result2, 8, 97, 9, refOp, expectedKind); + assertHintValues(result2, 9, 97, 12, refOp, expectedKind); + assertHintValues(result2, 10, 98, 9, refOp, expectedKind); + assertHintValues(result2, 11, 98, 12, refOp, expectedKind); + assertHintValues(result2, 12, 99, 9, refOp, expectedKind); + assertHintValues(result2, 13, 100, 9, refOp, expectedKind); + assertHintValues(result2, 14, 103, 9, refOp, expectedKind); + assertHintValues(result2, 15, 104, 9, refOp, expectedKind); + }); + + test("[Inlay Hints - reference operator and param name, show space]", async () => { + const range: vscode.Range = new vscode.Range(new vscode.Position(87, 0), new vscode.Position(96, 0)); + + await changeInlayHintSetting(parameterNamesEnabled, enabled); + await changeInlayHintSetting(parameterNamesHideUnderScore, enabled); + await changeInlayHintSetting(parameterNamesSuppress, disabled); + await changeInlayHintSetting(referenceOperatorEnabled, enabled); + await changeInlayHintSetting(referenceOperatorShowSpace, disabled); + await getIntelliSenseStatus; + const result1 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result1.length, 12, "Incorrect number of results."); + const expectedKind = vscode.InlayHintKind.Parameter; + assertHintValues(result1, 0, 87, 9, "&first:", expectedKind); + assertHintValues(result1, 1, 87, 12, "&last:", expectedKind); + assertHintValues(result1, 2, 87, 15, "flag:", expectedKind); + assertHintValues(result1, 3, 88, 9, "&first:", expectedKind); + assertHintValues(result1, 4, 88, 22, "&last:", expectedKind); + assertHintValues(result1, 5, 88, 25, "flag:", expectedKind); + assertHintValues(result1, 6, 89, 9, "&first:", expectedKind); + assertHintValues(result1, 7, 90, 9, "&last:", expectedKind); + assertHintValues(result1, 8, 91, 9, "flag:", expectedKind); + assertHintValues(result1, 9, 93, 9, "&first:", expectedKind); + assertHintValues(result1, 10, 94, 9, "&last:", expectedKind); + assertHintValues(result1, 11, 95, 9, "flag:", expectedKind); + + await changeInlayHintSetting(referenceOperatorShowSpace, enabled); + await getIntelliSenseStatus; + const result2 = await vscode.commands.executeCommand('vscode.executeInlayHintProvider', fileUri, range); + assert.strictEqual(result2.length, 12, "Incorrect number of results."); + assertHintValues(result2, 0, 87, 9, "& first:", expectedKind); + assertHintValues(result2, 1, 87, 12, "& last:", expectedKind); + assertHintValues(result2, 2, 87, 15, "flag:", expectedKind); + assertHintValues(result2, 3, 88, 9, "& first:", expectedKind); + assertHintValues(result2, 4, 88, 22, "& last:", expectedKind); + assertHintValues(result2, 5, 88, 25, "flag:", expectedKind); + assertHintValues(result2, 6, 89, 9, "& first:", expectedKind); + assertHintValues(result2, 7, 90, 9, "& last:", expectedKind); + assertHintValues(result2, 8, 91, 9, "flag:", expectedKind); + assertHintValues(result2, 9, 93, 9, "& first:", expectedKind); + assertHintValues(result2, 10, 94, 9, "& last:", expectedKind); + assertHintValues(result2, 11, 95, 9, "flag:", expectedKind); + }); + + async function changeInlayHintSetting(inlayHintSetting: string, valueNew: any): Promise { + const valueBeforeChange: any = inlayHintSettings.inspect(inlayHintSetting).globalValue; + if (valueBeforeChange !== valueNew) { + await inlayHintSettings.update(inlayHintSetting, valueNew, vscode.ConfigurationTarget.Global); + const valueAfterChange: any = inlayHintSettings.inspect(inlayHintSetting).globalValue; + assert.strictEqual(valueAfterChange, valueNew, `Unable to change setting: ${inlayHintSetting}`); + } + } + + function assertHintValues( + actualHintResults: any, + resultNumber: number, + expectedLine: number, + expectedCharacter: number, + expectedLabel: string, + expectedKind: any): void { + assert.strictEqual(actualHintResults[resultNumber].position.line, expectedLine, `Incorrect line for result ${resultNumber}.`); + assert.strictEqual(actualHintResults[resultNumber].position.character, expectedCharacter, `Incorrect character for result ${resultNumber}.`); + assert.strictEqual(actualHintResults[resultNumber].label, expectedLabel, `Incorrect label for result ${resultNumber}.`); + assert.strictEqual(actualHintResults[resultNumber].kind, expectedKind, `Incorrect kind for result ${resultNumber}.`); + } +}); diff --git a/Extension/test/integrationTests/IntelliSenseFeatures/quickInfo.test.ts b/Extension/test/integrationTests/IntelliSenseFeatures/quickInfo.test.ts index 9e61d0da0f..85195080bc 100644 --- a/Extension/test/integrationTests/IntelliSenseFeatures/quickInfo.test.ts +++ b/Extension/test/integrationTests/IntelliSenseFeatures/quickInfo.test.ts @@ -48,7 +48,7 @@ suite("[Quick info test]", function(): void { const result: vscode.Hover[] = (await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(35, 23))); const expected_full_comment: string = `\`\`\`cpp\nbool isEven(int value)\n\`\`\` \nVerifies if input is even number or not`; const expectedMap: Map = new Map(); - expectedMap.set("win32", `\`\`\`cpp\nbool isEven(int value)\n\`\`\``); // Running test locally returns full comment, but running test on Azure pipeline does not. + expectedMap.set("win32", expected_full_comment); expectedMap.set("linux", expected_full_comment); expectedMap.set("darwin", expected_full_comment); @@ -60,7 +60,7 @@ suite("[Quick info test]", function(): void { test("[Hover over function call - Doxygen comment]", async () => { const result: vscode.Hover[] = (await vscode.commands.executeCommand('vscode.executeHoverProvider', fileUri, new vscode.Position(36, 9))); - const expected_full_comment: string = `\`\`\`cpp\nint testDoxygen(int base, int height)\n\`\`\` \nCalculates area of rectangle \n \n**Template Parameters:** \n\`T\` – is template param \n \n**Parameters:** \n\`base\` – is horizontal length \n\`height\` – is virtical length \n \n**Returns:** \nArea of rectangle \n \n**Exceptions:** \nThis is an exception comment`; + const expected_full_comment: string = `\`\`\`cpp\nint testDoxygen(int base, int height)\n\`\`\` \nCalculates area of rectangle \n \n**Template Parameters:** \n\`T\` – is template param \n \n**Parameters:** \n\`base\` – is horizontal length \n\`height\` – is vertical length \n \n**Returns:** \nArea of rectangle \n \n**Exceptions:** \nThis is an exception comment`; const expectedMap: Map = new Map(); expectedMap.set("win32", `\`\`\`cpp\nint testDoxygen(int base, int height)\n\`\`\``); // Running test locally returns full comment, but running test on Azure pipeline does not. expectedMap.set("linux", expected_full_comment); diff --git a/Extension/test/integrationTests/IntelliSenseFeatures/runTest.ts b/Extension/test/integrationTests/IntelliSenseFeatures/runTest.ts index 3ebe0a01d7..4e60a48b0c 100644 --- a/Extension/test/integrationTests/IntelliSenseFeatures/runTest.ts +++ b/Extension/test/integrationTests/IntelliSenseFeatures/runTest.ts @@ -26,8 +26,9 @@ async function main() { // Download VS Code, unzip it and run the integration test await runTests({ launchArgs, extensionDevelopmentPath, extensionTestsPath }); } catch (err) { - console.log('VS Code returned an unexpected error code, ignore it'); - process.exit(0); + console.log(err); + console.log('Failed to run tests.'); + process.exit(1); } } diff --git a/Extension/test/integrationTests/debug/runTest.ts b/Extension/test/integrationTests/debug/runTest.ts index 9c7f74cd2b..51832807d5 100644 --- a/Extension/test/integrationTests/debug/runTest.ts +++ b/Extension/test/integrationTests/debug/runTest.ts @@ -17,8 +17,9 @@ async function main() { // Download VS Code, unzip it and run the integration test await runTests({ launchArgs, extensionDevelopmentPath, extensionTestsPath }); } catch(err) { - console.log('VS Code returned an unexpected error code, ignore it'); - process.exit(0); + console.log(err); + console.log('Failed to run tests.'); + process.exit(1); } } diff --git a/Extension/test/integrationTests/languageServer/runTest.ts b/Extension/test/integrationTests/languageServer/runTest.ts index 9cc646b0a8..af6e330e4c 100644 --- a/Extension/test/integrationTests/languageServer/runTest.ts +++ b/Extension/test/integrationTests/languageServer/runTest.ts @@ -19,8 +19,9 @@ async function main() { // Download VS Code, unzip it and run the integration test await runTests({ launchArgs, extensionDevelopmentPath, extensionTestsPath }); } catch (err) { - console.log('VS Code returned an unexpected error code, ignore it'); - process.exit(0); + console.log(err); + console.log('Failed to run tests.'); + process.exit(1); } } diff --git a/Extension/test/unitTests/runTest.ts b/Extension/test/unitTests/runTest.ts index 2d395049ca..a483feff77 100644 --- a/Extension/test/unitTests/runTest.ts +++ b/Extension/test/unitTests/runTest.ts @@ -17,8 +17,9 @@ async function main() { // Download VS Code, unzip it and run the integration test await runTests({ launchArgs, extensionDevelopmentPath, extensionTestsPath }); } catch (err) { - console.log('VS Code returned an unexpected error code, ignore it'); - process.exit(0); + console.log(err); + console.log('Failed to run tests.'); + process.exit(1); } } diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 6df56f302b..31b1826c79 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -101,6 +101,46 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@jridgewell/gen-mapping@^0.3.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/source-map@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" + integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@^0.3.9": + version "0.3.14" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" + integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@microsoft/1ds-core-js@3.2.3", "@microsoft/1ds-core-js@^3.2.3": version "3.2.3" resolved "https://registry.yarnpkg.com/@microsoft/1ds-core-js/-/1ds-core-js-3.2.3.tgz#2217d92ec8b073caa4577a13f40ea3a5c4c4d4e7" @@ -655,6 +695,11 @@ acorn@^8.0.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.1.0.tgz#52311fd7037ae119cbb134309e901aa46295b3fe" integrity sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA== +acorn@^8.5.0: + version "8.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" + integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== + agent-base@4, agent-base@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" @@ -5044,10 +5089,10 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@~0.5.19: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -5067,7 +5112,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3, source-map@~0.7.2: +source-map@^0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== @@ -5404,14 +5449,15 @@ terser-webpack-plugin@^5.1.1: source-map "^0.6.1" terser "^5.5.1" -terser@^5.5.1: - version "5.6.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.1.tgz#a48eeac5300c0a09b36854bf90d9c26fb201973c" - integrity sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw== +terser@^5.14.2, terser@^5.5.1: + version "5.14.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10" + integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA== dependencies: + "@jridgewell/source-map" "^0.3.2" + acorn "^8.5.0" commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.19" + source-map-support "~0.5.20" text-table@^0.2.0: version "0.2.0" @@ -5876,31 +5922,32 @@ vscode-dts@^0.3.2: prompts "^2.1.0" rimraf "^3.0.0" -vscode-jsonrpc@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9" - integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg== +vscode-jsonrpc@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.0.1.tgz#f30b0625ebafa0fb3bc53e934ca47b706445e57e" + integrity sha512-N/WKvghIajmEvXpatSzvTvOIz61ZSmOSa4BRA4pTLi+1+jozquQKP/MkaylP9iB68k73Oua1feLQvH3xQuigiQ== -vscode-languageclient@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-5.2.1.tgz#7cfc83a294c409f58cfa2b910a8cfeaad0397193" - integrity sha512-7jrS/9WnV0ruqPamN1nE7qCxn0phkH5LjSgSp9h6qoJGoeAKzwKz/PF6M+iGA/aklx4GLZg1prddhEPQtuXI1Q== +vscode-languageclient@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-8.0.1.tgz#bf5535c4463a78daeaca0bcb4f5868aec86bb301" + integrity sha512-9XoE+HJfaWvu7Y75H3VmLo5WLCtsbxEgEhrLPqwt7eyoR49lUIyyrjb98Yfa50JCMqF2cePJAEVI6oe2o1sIhw== dependencies: - semver "^5.5.0" - vscode-languageserver-protocol "3.14.1" + minimatch "^3.0.4" + semver "^7.3.5" + vscode-languageserver-protocol "3.17.1" -vscode-languageserver-protocol@3.14.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz#b8aab6afae2849c84a8983d39a1cf742417afe2f" - integrity sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g== +vscode-languageserver-protocol@3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.1.tgz#e801762c304f740208b6c804a0cf21f2c87509ed" + integrity sha512-BNlAYgQoYwlSgDLJhSG+DeA8G1JyECqRzM2YO6tMmMji3Ad9Mw6AW7vnZMti90qlAKb0LqAlJfSVGEdqMMNzKg== dependencies: - vscode-jsonrpc "^4.0.0" - vscode-languageserver-types "3.14.0" + vscode-jsonrpc "8.0.1" + vscode-languageserver-types "3.17.1" -vscode-languageserver-types@3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743" - integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A== +vscode-languageserver-types@3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.1.tgz#c2d87fa7784f8cac389deb3ff1e2d9a7bef07e16" + integrity sha512-K3HqVRPElLZVVPtMeKlsyL9aK0GxGQpvtAUTfX4k7+iJ4mc1M+JM+zQwkgGy2LzY0f0IAafe8MKqIkJrxfGGjQ== vscode-nls-dev@^4.0.0-next.1: version "4.0.0-next.1" @@ -6216,4 +6263,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== \ No newline at end of file + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==