Skip to content

Commit e4e83f0

Browse files
authored
Merge branch 'main' into seanmcm/localization2
2 parents ea7031b + 301f9a6 commit e4e83f0

File tree

11 files changed

+52
-23
lines changed

11 files changed

+52
-23
lines changed

.github/actions/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@octokit/rest": "^19.0.3",
1616
"@slack/web-api": "^6.9.1",
1717
"applicationinsights": "^2.5.1",
18-
"axios": "^1.6.8",
18+
"axios": "^1.8.2",
1919
"uuid": "^8.3.2"
2020
},
2121
"devDependencies": {

Extension/.vscodeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ typings/**
4646
import_edge_strings.js
4747
localized_string_ids.h
4848
translations_auto_pr.js
49+
readme.developer.md
50+
Reinstalling the Extension.md
51+
*.d.ts
4952

5053
# ignore i18n language files
5154
i18n/**

Extension/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
},
2424
"homepage": "https://github.com/Microsoft/vscode-cpptools",
2525
"qna": "https://github.com/Microsoft/vscode-cpptools/issues",
26+
"extensionKind": [
27+
"workspace"
28+
],
2629
"keywords": [
2730
"C",
2831
"C++",
@@ -1861,6 +1864,7 @@
18611864
"bugprone-assert-side-effect",
18621865
"bugprone-assignment-in-if-condition",
18631866
"bugprone-bad-signal-to-kill-thread",
1867+
"bugprone-bitwise-pointer-cast",
18641868
"bugprone-bool-pointer-implicit-conversion",
18651869
"bugprone-branch-clone",
18661870
"bugprone-casting-through-void",
@@ -1881,6 +1885,7 @@
18811885
"bugprone-inc-dec-in-conditions",
18821886
"bugprone-incorrect-*",
18831887
"bugprone-incorrect-enable-if",
1888+
"bugprone-incorrect-enable-shared-from-this",
18841889
"bugprone-incorrect-roundings",
18851890
"bugprone-infinite-loop",
18861891
"bugprone-integer-division",
@@ -1899,6 +1904,7 @@
18991904
"bugprone-narrowing-conversions",
19001905
"bugprone-no-escape",
19011906
"bugprone-non-zero-enum-to-bool-conversion",
1907+
"bugprone-nondeterministic-pointer-iteration-order",
19021908
"bugprone-not-null-terminated-result",
19031909
"bugprone-optional-value-conversion",
19041910
"bugprone-parent-virtual-call",
@@ -1932,6 +1938,7 @@
19321938
"bugprone-suspicious-stringview-data-usage",
19331939
"bugprone-swapped-arguments",
19341940
"bugprone-switch-missing-default-case",
1941+
"bugprone-tagged-union-member-count",
19351942
"bugprone-terminating-continue",
19361943
"bugprone-throw-keyword-missing",
19371944
"bugprone-too-small-loop-variable",
@@ -2323,6 +2330,7 @@
23232330
"modernize-use-equals-*",
23242331
"modernize-use-equals-default",
23252332
"modernize-use-equals-delete",
2333+
"modernize-use-integer-sign-comparison",
23262334
"modernize-use-nodiscard",
23272335
"modernize-use-noexcept",
23282336
"modernize-use-nullptr",
@@ -2382,6 +2390,7 @@
23822390
"portability-restrict-system-includes",
23832391
"portability-simd-intrinsics",
23842392
"portability-std-allocator-const",
2393+
"portability-template-virtual-member-function",
23852394
"readability-*",
23862395
"readability-avoid-*",
23872396
"readability-avoid-const-params-in-decls",
@@ -2515,6 +2524,7 @@
25152524
"bugprone-assert-side-effect",
25162525
"bugprone-assignment-in-if-condition",
25172526
"bugprone-bad-signal-to-kill-thread",
2527+
"bugprone-bitwise-pointer-cast",
25182528
"bugprone-bool-pointer-implicit-conversion",
25192529
"bugprone-branch-clone",
25202530
"bugprone-casting-through-void",
@@ -2535,6 +2545,7 @@
25352545
"bugprone-inc-dec-in-conditions",
25362546
"bugprone-incorrect-*",
25372547
"bugprone-incorrect-enable-if",
2548+
"bugprone-incorrect-enable-shared-from-this",
25382549
"bugprone-incorrect-roundings",
25392550
"bugprone-infinite-loop",
25402551
"bugprone-integer-division",
@@ -2553,6 +2564,7 @@
25532564
"bugprone-narrowing-conversions",
25542565
"bugprone-no-escape",
25552566
"bugprone-non-zero-enum-to-bool-conversion",
2567+
"bugprone-nondeterministic-pointer-iteration-order",
25562568
"bugprone-not-null-terminated-result",
25572569
"bugprone-optional-value-conversion",
25582570
"bugprone-parent-virtual-call",
@@ -2586,6 +2598,7 @@
25862598
"bugprone-suspicious-stringview-data-usage",
25872599
"bugprone-swapped-arguments",
25882600
"bugprone-switch-missing-default-case",
2601+
"bugprone-tagged-union-member-count",
25892602
"bugprone-terminating-continue",
25902603
"bugprone-throw-keyword-missing",
25912604
"bugprone-too-small-loop-variable",
@@ -2977,6 +2990,7 @@
29772990
"modernize-use-equals-*",
29782991
"modernize-use-equals-default",
29792992
"modernize-use-equals-delete",
2993+
"modernize-use-integer-sign-comparison",
29802994
"modernize-use-nodiscard",
29812995
"modernize-use-noexcept",
29822996
"modernize-use-nullptr",
@@ -3036,6 +3050,7 @@
30363050
"portability-restrict-system-includes",
30373051
"portability-simd-intrinsics",
30383052
"portability-std-allocator-const",
3053+
"portability-template-virtual-member-function",
30393054
"readability-*",
30403055
"readability-avoid-*",
30413056
"readability-avoid-const-params-in-decls",

Extension/src/LanguageServer/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ export interface ChatContextResult {
554554
compiler: string;
555555
targetPlatform: string;
556556
targetArchitecture: string;
557+
usedTestFrameworks: string[];
557558
}
558559

559560
interface FolderFilesEncodingChanged {

Extension/src/LanguageServer/codeAnalysis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ export function publishCodeAnalysisDiagnostics(params: PublishCodeAnalysisDiagno
379379
docPage = `checks${checksGroup}/${checksPage}.html`;
380380
}
381381
// TODO: This should be checking the clang-tidy version used to better support usage of older versions.
382-
const primaryDocUri: vscode.Uri = vscode.Uri.parse(`https://releases.llvm.org/19.1.0/tools/clang/tools/extra/docs/clang-tidy/${docPage}`);
382+
const primaryDocUri: vscode.Uri = vscode.Uri.parse(`https://releases.llvm.org/20.1.0/tools/clang/tools/extra/docs/clang-tidy/${docPage}`);
383383
diagnostic.code = { value: identifier.code, target: primaryDocUri };
384384

385385
if (new CppSettings().clangTidyCodeActionShowDocumentation) {

Extension/src/LanguageServer/copilotCompletionContextProvider.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ class DefaultValueFallback extends Error {
2323

2424
class CancellationError extends Error {
2525
static readonly Canceled = "Canceled";
26-
constructor() { super(CancellationError.Canceled); }
26+
constructor() {
27+
super(CancellationError.Canceled);
28+
this.name = this.message;
29+
}
2730
}
2831

29-
class InternalCancellationError extends Error {
30-
static readonly Canceled = "CpptoolsCanceled";
31-
constructor() { super(InternalCancellationError.Canceled); }
32+
class InternalCancellationError extends CancellationError {
3233
}
3334

3435
class CopilotCancellationError extends CancellationError {

Extension/src/LanguageServer/lmTool.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ export class CppConfigurationLanguageModelTool implements vscode.LanguageModelTo
168168
contextString += `The project targets the ${chatContext.targetArchitecture} architecture. `;
169169
telemetryProperties["targetArchitecture"] = chatContext.targetArchitecture;
170170
}
171-
171+
if (chatContext.usedTestFrameworks.length > 0) {
172+
contextString += `The project uses the following C++ test frameworks: ${chatContext.usedTestFrameworks.join(', ')}. `;
173+
telemetryProperties["testFrameworks"] = chatContext.usedTestFrameworks.join(', ');
174+
}
172175
return contextString;
173176
}
174177
catch {

Extension/src/nativeStrings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,5 +480,6 @@
480480
"refactor_extract_missing_return": "In the selected code, some control paths exit without setting the return value. This is supported only for scalar, numeric, and pointer return types.",
481481
"expand_selection": "Expand selection (to enable 'Extract to function')",
482482
"file_not_found_in_path2": "\"{0}\" not found in compile_commands.json files. 'includePath' from c_cpp_properties.json in folder '{1}' will be used for this file instead.",
483-
"copilot_hover_link": "Generate Copilot summary"
483+
"copilot_hover_link": "Generate Copilot summary",
484+
"browse_path_not_found": "Unable to index files from non-existent folder: {0}"
484485
}

Extension/test/scenarios/SingleRootProject/tests/lmTool.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
130130
});
131131

132132
const arrangeChatContextFromCppTools = ({ chatContextFromCppTools, isCpp, isHeaderFile }:
133-
{ chatContextFromCppTools?: ChatContextResult; isCpp?: boolean; isHeaderFile?: boolean } =
134-
{ chatContextFromCppTools: undefined, isCpp: undefined, isHeaderFile: false }
133+
{ chatContextFromCppTools?: ChatContextResult; isCpp?: boolean; isHeaderFile?: boolean } =
134+
{ chatContextFromCppTools: undefined, isCpp: undefined, isHeaderFile: false }
135135
) => {
136136
activeClientStub.getChatContext.resolves(chatContextFromCppTools);
137137
sinon.stub(util, 'isCpp').returns(isCpp ?? true);
@@ -145,7 +145,8 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
145145
standardVersion: 'c++20',
146146
compiler: 'msvc',
147147
targetPlatform: 'windows',
148-
targetArchitecture: 'x64'
148+
targetArchitecture: 'x64',
149+
usedTestFrameworks: ['GTest', 'Catch2']
149150
}
150151
});
151152

@@ -157,12 +158,14 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
157158
"compiler": 'MSVC',
158159
"standardVersion": 'C++20',
159160
"targetPlatform": 'Windows',
160-
"targetArchitecture": 'x64'
161+
"targetArchitecture": 'x64',
162+
'testFrameworks': 'GTest, Catch2'
161163
})));
162164
ok(result, 'result should not be undefined');
163165
const text = result.content[0] as vscode.LanguageModelTextPart;
164166
ok(text, 'result should contain a text part');
165-
ok(text.value === 'The user is working on a C++ project. The project uses language version C++20. The project compiles using the MSVC compiler. The project targets the Windows platform. The project targets the x64 architecture. ');
167+
const traits_text = `The user is working on a C++ project. The project uses language version C++20. The project compiles using the MSVC compiler. The project targets the Windows platform. The project targets the x64 architecture. The project uses the following C++ test frameworks: GTest, Catch2. `;
168+
ok(text.value === traits_text);
166169
});
167170

168171
const testGetProjectContext = async ({
@@ -184,7 +187,8 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
184187
standardVersion: 'c++20',
185188
compiler: compiler,
186189
targetPlatform: 'windows',
187-
targetArchitecture: 'x64'
190+
targetArchitecture: 'x64',
191+
usedTestFrameworks: []
188192
}
189193
});
190194

@@ -225,7 +229,8 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
225229
standardVersion: 'gnu++17',
226230
compiler: 'javac',
227231
targetPlatform: 'arduino',
228-
targetArchitecture: 'bar'
232+
targetArchitecture: 'bar',
233+
usedTestFrameworks: []
229234
}
230235
});
231236
const telemetryProperties: Record<string, string> = {};

0 commit comments

Comments
 (0)