Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/meson/introspection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as path from "path";
import { exec, parseJSONFileIfExists } from "../utils";
import { workspace } from "vscode";
import { exec, parseJSONFileIfExists, extensionConfiguration, resolveSymlinkPath } from "../utils";
import {
Targets,
Dependencies,
Expand Down Expand Up @@ -28,6 +29,20 @@ export async function getMesonTargets(build: string) {
return t;
});
}
const root = workspace.workspaceFolders[0].uri.path;
let adapt = (p) => {
return resolveSymlinkPath(root, p);
};
parsed = parsed.map(t => {
t.defined_in = adapt(t.defined_in);
t.extra_files.map(adapt);
t.filename = t.filename.map(adapt);
t.target_sources.map(s => {
s.generated_sources.map(adapt);
s.sources.map(adapt);
});
return t;
});
return parsed;
}
export async function getMesonBuildOptions(build: string) {
Expand Down
1 change: 1 addition & 0 deletions src/meson/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface Target {
id: string;
type: TargetType;
defined_in: string;
extra_files?: string[];
subproject: string | null;
filename: string[];
build_by_default: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/treeview/nodes/sources.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as path from "path";
import * as vscode from "vscode";

import { extensionRelative, randomString } from "../../utils";
import { extensionRelative, randomString, resolveSymlinkPath } from "../../utils";
import { BaseNode } from "../basenode";
import { BaseFileDirectoryNode } from "./base";

export class TargetSourcesNode extends BaseFileDirectoryNode {
constructor(rootFolder: string, private readonly allFiles: string[]) {
super(rootFolder, allFiles);
super(rootFolder, allFiles.map(p => resolveSymlinkPath(rootFolder, p)));
}

getTreeItem() {
Expand Down
4 changes: 4 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,7 @@ export function arrayIncludes<T>(array: T[], value: T) {
export function isThenable<T>(x: vscode.ProviderResult<T>): x is Thenable<T> {
return arrayIncludes(Object.getOwnPropertyNames(x), "then");
}

export function resolveSymlinkPath(root, p) {
return path.join(root, path.relative(fs.realpathSync(root), p));
}
Loading