Skip to content

Commit

Permalink
environment: print which root we are using
Browse files Browse the repository at this point in the history
  • Loading branch information
phillco committed Jul 15, 2023
1 parent effde0f commit 47f3220
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/cursorless-vscode/src/sidecar/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { registerFileWatchers } from "./synchronization";
import { startCommandServer } from "./commandServer";
import * as path from "path";
import {isTesting} from "@cursorless/common";
import * as os from "os";

/**
* Returns whether we should run as the Cursorless everywhere sidecar.
Expand Down Expand Up @@ -53,10 +54,15 @@ export function sidecarSetup(rootDirectory: string, sidecarPrefix: string) {
registerFileWatchers(rootDirectory);
startCommandServer(rootDirectory);

const homeDir = os.homedir();
let rootDirectoryNice = rootDirectory;
if (rootDirectory.startsWith(homeDir)) {
rootDirectoryNice = "~" + rootDirectory.slice(homeDir.length);
}

vscode.window.showInformationMessage(
`Cursorless has successfully started in sidecar mode!${
sidecarPrefix ? ` (prefix: ${sidecarPrefix}/)` : ""
}`,
`Cursorless sidecar ready! (root: ${rootDirectoryNice})`
,
);
}

Expand Down

0 comments on commit 47f3220

Please sign in to comment.