Skip to content

Commit

Permalink
Rethink dottyIde check
Browse files Browse the repository at this point in the history
  • Loading branch information
gabro committed Jan 18, 2020
1 parent 81d6b58 commit 32b70cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/metals-languageclient/src/getJavaOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { parse } from "shell-quote";

/**
* Compute all the relevant Java options by combining:
* - the .jvmopts file in the workspace root
* - the JAVA_OPTS environment variable
* - the JAVA_FLAGSenvironment variable
* - the `.jvmopts` file in the workspace root
* - the `JAVA_OPTS` environment variable
* - the `JAVA_FLAGS` environment variable
*
* @param workspaceRoot the workspace root path, if any
*/
Expand Down
13 changes: 9 additions & 4 deletions packages/metals-languageclient/src/isDottyIdeEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@ import * as path from "path";
import { existsSync } from "fs";

/**
* Whether Dotty IDE is enabled on this project
* Check whether Dotty IDE is enabled on this project
*
* @param workspaceRoot the workspace root, if defined
*/
export function isDottyIdeEnabled(workspaceRoot: string | undefined): boolean {
export function checkDottyIde(
workspaceRoot: string | undefined
): { enabled: true; path: string } | { enabled: false } {
if (workspaceRoot) {
const dottyIdeArtifactPath = path.join(
workspaceRoot,
".dotty-ide-artifact"
);
return existsSync(dottyIdeArtifactPath);
return {
enabled: existsSync(dottyIdeArtifactPath),
path: dottyIdeArtifactPath
};
}
return false;
return { enabled: false };
}

0 comments on commit 32b70cc

Please sign in to comment.