-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Add CopilotRelated command #59963
base: main
Are you sure you want to change the base?
Add CopilotRelated command #59963
Conversation
Add a command to provide information about a file for copilot.
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, @zkat, and @joj for you. Feel free to loop in other consumers/maintainers if necessary. |
@@ -3345,6 +3345,12 @@ export function createLanguageService( | |||
); | |||
} | |||
|
|||
function getImports(fileName: string): readonly string[] { | |||
synchronizeHostData(); |
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.
If you are using synchronize host data this is not syntax operation. Need to add this to invalidOperationsInPartialSemanticMode
Need to add protocol command to invalidPartialSemanticModeCommands
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 don't know if I need to synchronize host data to call getResolvedModuleFromModuleSpecifier. How can I tell?
(I'm guessing the answer is yes, though.)
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.
If you need to use more than open file , it needs to synchronize data .. that is anything that uses program needs to synchronize host data
@@ -2034,6 +2033,14 @@ export class Session<TMessage = string> implements EventSender { | |||
return this.mapTextChangesToCodeEdits(changes); | |||
} | |||
|
|||
private getCopilotRelatedInfo(args: protocol.FileRequestArgs): protocol.CopilotRelatedItems { | |||
const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); |
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 doesnt look like syntax operation : need to use const { file, project } = this.getFileAndProject(args);
Add a command to provide information about a file for copilot.
Associated VSCode PR: (not available yet)
@genlu you were interested in seeing this.