Skip to content

Commit

Permalink
better workspace folder selection
Browse files Browse the repository at this point in the history
  • Loading branch information
cademack committed Jul 16, 2024
1 parent 1f1dbf2 commit 6295a40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/language/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ export class AmalgamDefinitionProvider implements vscode.DefinitionProvider {
return undefined;
}

const rootPath = workspaceFolders[0].uri.fsPath;
const files = await this.getAllAmlgFiles(rootPath);

const workspaceFolder = vscode.workspace.getWorkspaceFolder(document.uri);
if (!workspaceFolder) {
return undefined;
}
const files = await this.getAllAmlgFiles(workspaceFolder.uri.fsPath);

for (const file of files) {
if (token.isCancellationRequested) {
Expand Down

0 comments on commit 6295a40

Please sign in to comment.