Skip to content

Commit

Permalink
fix: error on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed Oct 13, 2024
1 parent 96af585 commit 47cd21a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function activate(context: vscode.ExtensionContext) {

if (configuration.get<boolean>("showActiveToolsDisplay")) {
// Draw the active tools display when the client is ready to have it pop up
client.onReady().then(() => drawActiveToolsDisplay(vscode.window.activeTextEditor!.selection.active, vscode.window.activeTextEditor!.document));
client.onReady().then(() => drawActiveToolsDisplay(vscode.window.activeTextEditor?.selection.active, vscode.window.activeTextEditor?.document));
}

// Start the client. This will also launch the server
Expand Down Expand Up @@ -300,6 +300,7 @@ function parseActiveTools(str: string): ActiveTool[] {
}

async function drawActiveToolsDisplay(cursorPos: vscode.Position, document: vscode.TextDocument) {
if (!cursorPos || !document) return;
const toolsStr: string = await client.sendRequest("p2tas/activeTools", [document.uri, cursorPos.line]);
const tools = parseActiveTools(toolsStr);

Expand Down

0 comments on commit 47cd21a

Please sign in to comment.