MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / showCopilotContent

Function showCopilotContent

Extension/src/LanguageServer/extension.ts:1666–1692  ·  view source on GitHub ↗
(copilotHoverProvider: CopilotHoverProvider, hoverDocument: vscode.TextDocument, hoverPosition: vscode.Position, content?: string)

Source from the content-addressed store, hash-verified

1664}
1665
1666async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, hoverDocument: vscode.TextDocument, hoverPosition: vscode.Position, content?: string): Promise<boolean> {
1667 // Check if the cursor has been manually moved by the user. If so, exit.
1668 const currentCursorPosition = vscode.window.activeTextEditor?.selection.active;
1669 if (!currentCursorPosition?.isEqual(hoverPosition)) {
1670 // Reset implies cancellation, but we need to ensure cancellation is acknowledged before returning.
1671 copilotHoverProvider.reset();
1672 }
1673
1674 if (copilotHoverProvider.isCancelled(hoverDocument, hoverPosition)) {
1675 return false;
1676 }
1677
1678 await vscode.commands.executeCommand('cursorMove', { to: 'right' });
1679 await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus' });
1680
1681 if (content) {
1682 copilotHoverProvider.showContent(content);
1683 }
1684
1685 if (copilotHoverProvider.isCancelled(hoverDocument, hoverPosition)) {
1686 return false;
1687 }
1688 await vscode.commands.executeCommand('cursorMove', { to: 'left' });
1689 await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus' });
1690
1691 return true;
1692}
1693
1694async function onSetVsDeveloperEnvironment(sender?: any): Promise<void> {
1695 let success: boolean = true;

Callers 2

onCopilotHoverFunction · 0.85
reportCopilotFailureFunction · 0.85

Calls 3

isCancelledMethod · 0.80
showContentMethod · 0.80
resetMethod · 0.65

Tested by

no test coverage detected