Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid relativizing paths in the project outline
Browse files Browse the repository at this point in the history
In the project outline view, paths for the Makefile and build log were
automatically made relative. If the setting was an absolute path, the
result would be ugly:

For a makeDirectory setting '/tmp/amhello-debug', the outline would print

Makefile: [../../../tmp/amhello-debug/Makefile]

This was not only unsightly, but also wrong. See
https://unix.stackexchange.com/questions/13858/do-the-parent-directorys-permissions-matter-when-accessing-a-subdirectory

In short, if one of the parent directories (..) would be inaccessible,
the ../../../tmp/amhello-debug path is wrong because it's inaccessible,
even though /tmp/amhello-debug is accessible.
drok committed Oct 17, 2023

Verified

This commit was signed with the committer’s verified signature.
drok Radu Hociung
1 parent b37f0e1 commit a0fbb58
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
Improvements:
- Add support for a post configure script. [#391](https://github.com/microsoft/vscode-makefile-tools/issues/391)
- Add support for post-configure and pre-configure script arguments, both globally and per configuration. [#151](https://github.com/microsoft/vscode-makefile-tools/issues/151)
- Avoid relativizing paths in the project outline. [#519](https://github.com/microsoft/vscode-makefile-tools/pull/519) [@drok sponsored by @Mergesium](https://github.com/drok)

## 0.7.0
Improvements:
4 changes: 2 additions & 2 deletions src/tree.ts
Original file line number Diff line number Diff line change
@@ -336,9 +336,9 @@ export class ProjectOutlineProvider implements vscode.TreeDataProvider<BaseNode>
this._currentConfigurationItem.update(configuration || this._unsetString);
this._currentBuildTargetItem.update(buildTarget || this._unsetString);
await this._currentLaunchTargetItem.update(launchTarget || this._unsetString);
this._currentMakefilePathInfoItem.update(makefilePathInfo || this._unsetString, this.pathDisplayed(makefilePathInfo, "Makefile", false, true));
this._currentMakefilePathInfoItem.update(makefilePathInfo || this._unsetString, this.pathDisplayed(makefilePathInfo, "Makefile", false, false));
this._currentMakePathInfoItem.update(makePathInfo || this._unsetString, this.pathDisplayed(makePathInfo, "Make", true, false));
this._currentBuildLogPathInfoItem.update(buildLogInfo || this._unsetString, this.pathDisplayed(buildLogInfo, "Build Log", false, true));
this._currentBuildLogPathInfoItem.update(buildLogInfo || this._unsetString, this.pathDisplayed(buildLogInfo, "Build Log", false, false));

this.updateTree();
}

0 comments on commit a0fbb58

Please sign in to comment.