Skip to content

Commit

Permalink
Add the ability to detect when running remotely
Browse files Browse the repository at this point in the history
See #1738.
  • Loading branch information
DanTup committed Jul 8, 2019
1 parent 28dfd80 commit b5fb2f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/shared/vscode/utils.ts
@@ -1,6 +1,12 @@
import { commands, Uri } from "vscode";
import { commands, ExtensionKind, extensions, Uri } from "vscode";
import { dartCodeExtensionIdentifier } from "../constants";
import { forceWindowsDriveLetterToUppercase } from "../utils";

const dartExtension = extensions.getExtension(dartCodeExtensionIdentifier);
// The extension kind is declared as Workspace, but VS Code will return UI in the
// case that there is no remote extension host.
export const isRunningLocally = dartExtension.extensionKind === ExtensionKind.UI;

export function fsPath(uri: Uri | string) {
// tslint:disable-next-line:disallow-fspath
return forceWindowsDriveLetterToUppercase(uri instanceof Uri ? uri.fsPath : uri);
Expand Down

0 comments on commit b5fb2f1

Please sign in to comment.