-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ContextProvider resolve handler improvements #13296
base: main
Are you sure you want to change the base?
Conversation
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should SnippetEntry be removed? It doesn't appear to be referenced anymore?
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
FYI, I have a PR opened to clean up the compiler argument traits, which may impact this PR, see #13278. |
Should your PR get checked in first, right? |
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
8c68910
to
b0847de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cppCodeSnippetsFeatureNames doesn't work if it's lowercased -- that seems a little error prone and unexpected, because the other C_Cpp settings values are case insensitive I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, but that doesn't appear to be a regression -- it looks like I modified the setting value to be lowercase and expected it to work.
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getEnabledFeatureNames splits by "," and breaks if ", " with a space after the comma is used -- that seems error prone. Should it be changed to handle space after a comma?
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
Extension/src/LanguageServer/copilotCompletionContextProvider.ts
Outdated
Show resolved
Hide resolved
-telemetry: fix cancellation events. -telemetry: more diag event for registration failure. -add fallback to SimilarFiles providers such as openTabs and/or related-files
b0847de
to
603f950
Compare
} | ||
telemetry.addTraitsMetadata(projectContext, telemetryProperties, telemetryMetrics); | ||
|
||
return copilotCompletionContext; | ||
} else { | ||
logMessage += `, result is missing`; | ||
telemetry.addResponseMetadata(true); | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returning undefined is a little strange because it's losing information that the caller seems to want to check.
} | ||
telemetry.addCompletionContextKind(copilotCompletionContextKind); | ||
telemetry.addResponseMetadata(copilotCompletionContext?.isResultMissing ?? true, | ||
copilotCompletionContext?.snippets?.length, copilotCompletionContext?.translationUnitUri, | ||
copilotCompletionContext?.caretOffset, copilotCompletionContext?.featureFlag); | ||
logMessage += ` (id:${copilotCompletionContext?.requestId}) `; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is odd/confusing, because ${copilotCompletionContext?.requestId
will be undefined if isResultMissing.
By returning the undefined as mention earlier, you're losing the requestId. Maybe that doesn't really matter but it makes the logging a little confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukka Should the snippets be trimmed for whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see unnecessary stuff sent to TypeScript like endLine. Can you remove that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving but it seems like some of the data sent to TypeScript could be cleaned up on the cpptools side.
Changes:
-new feature: add traits for C++ lang version
-telemetry: fix cancellation events.
-telemetry: more diag event for registration failure.