Skip to content

Commit 3571ad2

Browse files
authored
Merge pull request #139 from jukrb0x/master
fix: accept relative paths in `Lua.workspace.library`
2 parents 420f39b + 7bc8843 commit 3571ad2

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 { ConfigChange, getConfig, setConfig } from "../../languageserver";
34
import { createChildLogger } from "./logging.service";
45
import { LIBRARY_SETTING } from "../config";
@@ -23,7 +24,13 @@ export const getLibraryPaths = async (): Promise<
2324

2425
for (const folder of vscode.workspace.workspaceFolders) {
2526
const libraries = await getConfig(LIBRARY_SETTING, folder.uri);
26-
result.push({ folder, paths: libraries ?? [] });
27+
const libraryPaths = libraries.map((libraryPath: string) => {
28+
if (path.isAbsolute(libraryPath)) {
29+
return libraryPath;
30+
}
31+
return path.join(folder.uri.fsPath, libraryPath);
32+
})
33+
result.push({ folder, paths: libraryPaths ?? [] });
2734
}
2835

2936
return result;

0 commit comments

Comments
 (0)