Skip to content

Commit

Permalink
Switch to hhconfigPath config option
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfootjon committed Mar 29, 2021
1 parent d631410 commit c4da703
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@
"default": "hh_client",
"description": "Absolute path to the hh_client executable. This can be left empty if hh_client is already in your environment $PATH."
},
"hack.rootPath": {
"hack.hhconfigPath": {
"type": "string",
"default": "",
"description": "Relative path to the directory containing .hhconfig"
"default": ".hhconfig",
"description": "Workspace-relative path to .hhconfig file, the containing directory becomes the Hack Langauge Server root"
},
"hack.workspaceRootPath": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const hackConfig = vscode.workspace.getConfiguration("hack");
// tslint:disable-next-line:no-non-null-assertion
export const localWorkspacePath = vscode.workspace.workspaceFolders![0].uri
.fsPath;
export const workspaceRelativeRootPath = hackConfig.get<string>("rootPath") || "";
export const hhconfigPath = hackConfig.get<string>("hhconfigPath") || ".hhconfig";

export let clientPath = hackConfig.get<string>("clientPath") || "hh_client";
clientPath = clientPath.replace("${workspaceFolder}", localWorkspacePath);
Expand Down
3 changes: 2 additions & 1 deletion src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const mapFromWorkspaceUri = (file: vscode.Uri): string => {
if (config.remoteEnabled && config.remoteWorkspacePath) {
workspaceRoot = workspaceRoot.replace(config.localWorkspacePath, config.remoteWorkspacePath);
}
return workspaceRoot + "/" + config.workspaceRelativeRootPath;
const workspaceRelativeRoot = config.hhconfigPath.replace(/\.hhconfig$/, "")
return workspaceRoot + "/" + workspaceRelativeRoot.replace(".hhconfig", "");
};

/**
Expand Down

0 comments on commit c4da703

Please sign in to comment.