Skip to content

Commit 6c7afbc

Browse files
committed
fix: accept relative paths in Lua.workspace.library
1 parent 867826b commit 6c7afbc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/src/addon_manager/services/settings.service.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as vscode from "vscode";
2+
import * as path from "path";
23
import { getConfig, setConfig } from "../../languageserver";
34
import { createChildLogger } from "./logging.service";
45
import { LIBRARY_SETTING } from "../config";
@@ -25,7 +26,13 @@ export const getLibraryPaths = async (): Promise<
2526

2627
for (const folder of vscode.workspace.workspaceFolders) {
2728
const libraries = await getConfig(LIBRARY_SETTING, folder.uri);
28-
result.push({ folder, paths: libraries ?? [] });
29+
const libraryPaths = libraries.map((libraryPath: string) => {
30+
if (path.isAbsolute(libraryPath)) {
31+
return libraryPath;
32+
}
33+
return path.join(folder.uri.fsPath, libraryPath);
34+
})
35+
result.push({ folder, paths: libraryPaths ?? [] });
2936
}
3037

3138
return result;

0 commit comments

Comments
 (0)