(copilotHoverProvider: CopilotHoverProvider, hoverDocument: vscode.TextDocument, hoverPosition: vscode.Position, content?: string)
| 1664 | } |
| 1665 | |
| 1666 | async 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 | |
| 1694 | async function onSetVsDeveloperEnvironment(sender?: any): Promise<void> { |
| 1695 | let success: boolean = true; |
no test coverage detected