Skip to content

Commit b6e18b0

Browse files
authored
Merge pull request #13271 from microsoft/main
Merge for 1.24.0 (2nd time)
2 parents cb3964f + 69393c4 commit b6e18b0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Extension/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# C/C++ for Visual Studio Code Changelog
22

3-
## Version 1.24.0: Febrary 10, 2025
3+
## Version 1.24.0: Febrary 11, 2025
44
### New Feature
55
* Add experimental support for Copilot descriptions in hover tooltips, controlled by the `C_Cpp.copilotHover` setting. This feature is currently off by default and may be subject to A/B experimentation. To opt-out of Copilot Hover experiments, set `C_Cpp.copilotHover` to `disabled`.
66

77
### Enhancement
88
* Improve/fix the switch header/source feature. [#2635](https://github.com/microsoft/vscode-cpptools/issues/2635)
99

1010
### Bug Fixes
11+
* Fix an IntelliSense crash in `build_sections`. [#12666](https://github.com/microsoft/vscode-cpptools/issues/12666), [#12956](https://github.com/microsoft/vscode-cpptools/issues/12956)
1112
* Fix a bug in which hundreds of custom configuration requests could be sent on startup before the configuration provider has registered. [#13166](https://github.com/microsoft/vscode-cpptools/issues/13166)
1213
* Fix handling of the `-framework` compiler argument. [#13204](https://github.com/microsoft/vscode-cpptools/issues/13204)
1314
* Fix a potential race between didChange and didOpen. [PR #13209](https://github.com/microsoft/vscode-cpptools/pull/13209)

Extension/src/LanguageServer/copilotCompletionContextProvider.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export class CopilotCompletionContextProvider implements ContextResolver<CodeSni
7272
private static readonly providerId = 'ms-vscode.cpptools';
7373
private readonly completionContextCache: Map<string, CacheEntry> = new Map();
7474
private static readonly defaultCppDocumentSelector: DocumentSelector = [{ language: 'cpp' }, { language: 'c' }, { language: 'cuda-cpp' }];
75-
private static readonly defaultTimeBudgetFactor: number = 0.5;
75+
// A percentage expressed as an integer number, i.e. 50 means 50%.
76+
private static readonly defaultTimeBudgetFactor: number = 50;
7677
private static readonly defaultMaxCaretDistance = 4096;
7778
private completionContextCancellation = new vscode.CancellationTokenSource();
7879
private contextProviderDisposable: vscode.Disposable | undefined;
@@ -177,7 +178,7 @@ export class CopilotCompletionContextProvider implements ContextResolver<CodeSni
177178
private async fetchTimeBudgetFactor(context: ResolveRequest): Promise<number> {
178179
try {
179180
const budgetFactor = context.activeExperiments.get(CopilotCompletionContextProvider.CppCodeSnippetsTimeBudgetFactor);
180-
return (budgetFactor as number) ?? CopilotCompletionContextProvider.defaultTimeBudgetFactor;
181+
return ((budgetFactor as number) ?? CopilotCompletionContextProvider.defaultTimeBudgetFactor) / 100.0;
181182
} catch (e) {
182183
console.warn(`fetchTimeBudgetFactor(): error fetching ${CopilotCompletionContextProvider.CppCodeSnippetsTimeBudgetFactor}, using default: `, e);
183184
return CopilotCompletionContextProvider.defaultTimeBudgetFactor;
@@ -186,8 +187,8 @@ export class CopilotCompletionContextProvider implements ContextResolver<CodeSni
186187

187188
private async fetchMaxDistanceToCaret(context: ResolveRequest): Promise<number> {
188189
try {
189-
const budgetFactor = context.activeExperiments.get(CopilotCompletionContextProvider.CppCodeSnippetsMaxDistanceToCaret);
190-
return (budgetFactor as number) ?? CopilotCompletionContextProvider.defaultMaxCaretDistance;
190+
const maxDistance = context.activeExperiments.get(CopilotCompletionContextProvider.CppCodeSnippetsMaxDistanceToCaret);
191+
return (maxDistance as number) ?? CopilotCompletionContextProvider.defaultMaxCaretDistance;
191192
} catch (e) {
192193
console.warn(`fetchMaxDistanceToCaret(): error fetching ${CopilotCompletionContextProvider.CppCodeSnippetsMaxDistanceToCaret}, using default: `, e);
193194
return CopilotCompletionContextProvider.defaultMaxCaretDistance;

0 commit comments

Comments
 (0)