Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge for 1.24.0 (2nd time) #13271

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.24.0: Febrary 10, 2025
## Version 1.24.0: Febrary 11, 2025
### New Feature
* 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`.

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

### Bug Fixes
* 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)
* 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)
* Fix handling of the `-framework` compiler argument. [#13204](https://github.com/microsoft/vscode-cpptools/issues/13204)
* Fix a potential race between didChange and didOpen. [PR #13209](https://github.com/microsoft/vscode-cpptools/pull/13209)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export class CopilotCompletionContextProvider implements ContextResolver<CodeSni
private static readonly providerId = 'ms-vscode.cpptools';
private readonly completionContextCache: Map<string, CacheEntry> = new Map();
private static readonly defaultCppDocumentSelector: DocumentSelector = [{ language: 'cpp' }, { language: 'c' }, { language: 'cuda-cpp' }];
private static readonly defaultTimeBudgetFactor: number = 0.5;
// A percentage expressed as an integer number, i.e. 50 means 50%.
private static readonly defaultTimeBudgetFactor: number = 50;
private static readonly defaultMaxCaretDistance = 4096;
private completionContextCancellation = new vscode.CancellationTokenSource();
private contextProviderDisposable: vscode.Disposable | undefined;
Expand Down Expand Up @@ -177,7 +178,7 @@ export class CopilotCompletionContextProvider implements ContextResolver<CodeSni
private async fetchTimeBudgetFactor(context: ResolveRequest): Promise<number> {
try {
const budgetFactor = context.activeExperiments.get(CopilotCompletionContextProvider.CppCodeSnippetsTimeBudgetFactor);
return (budgetFactor as number) ?? CopilotCompletionContextProvider.defaultTimeBudgetFactor;
return ((budgetFactor as number) ?? CopilotCompletionContextProvider.defaultTimeBudgetFactor) / 100.0;
} catch (e) {
console.warn(`fetchTimeBudgetFactor(): error fetching ${CopilotCompletionContextProvider.CppCodeSnippetsTimeBudgetFactor}, using default: `, e);
return CopilotCompletionContextProvider.defaultTimeBudgetFactor;
Expand All @@ -186,8 +187,8 @@ export class CopilotCompletionContextProvider implements ContextResolver<CodeSni

private async fetchMaxDistanceToCaret(context: ResolveRequest): Promise<number> {
try {
const budgetFactor = context.activeExperiments.get(CopilotCompletionContextProvider.CppCodeSnippetsMaxDistanceToCaret);
return (budgetFactor as number) ?? CopilotCompletionContextProvider.defaultMaxCaretDistance;
const maxDistance = context.activeExperiments.get(CopilotCompletionContextProvider.CppCodeSnippetsMaxDistanceToCaret);
return (maxDistance as number) ?? CopilotCompletionContextProvider.defaultMaxCaretDistance;
} catch (e) {
console.warn(`fetchMaxDistanceToCaret(): error fetching ${CopilotCompletionContextProvider.CppCodeSnippetsMaxDistanceToCaret}, using default: `, e);
return CopilotCompletionContextProvider.defaultMaxCaretDistance;
Expand Down