Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add new macro
WorkspaceRealPath
The
WorkspaceRealPath
macro is identical toWorkspacePath
- but just expanded/converted by calling FileUtils::RealPath (realpath()
) - this means that any symlink present in the path is resolved.Reasoning for introduction of
WorkspaceRealPath
macro:I have a number of (FSW) projects that have to be placed on a network drive with a special and extremely long/deep directory layout (not my choice)
In order to eliminate the long/deep path leading to the project dirs of these projects - I have created a local project root with symlinks to the real projects - mission accomplished...
This has worked well with CodeLite until the switch from ctags to clangd (LSP)...
Here is an example of one the problems (there are actually more):
Clangd (LSP) returns filepaths as expanded (real)paths.
With a FSW project opened with a shortend (symlink) path - the Workspace pane file-tree does not recognize the expanded (real)path as a part of the FSW project - and hence it will not sync the file returned by LSP with the workspace pane file-tree.
But clangd (LSP) has a fix for that -
path-mappings
will translate a remote path into a local path (just what we (I) need)By adding the following into the clangd (LSP) command every thing works again:
--path-mappings=$(WorkspacePath)=$(WorkspaceRealPath)
Summary:
By introducing the
WorkspaceRealPath
macro the problems of mapping between "virtual" symlink paths and (real)paths are automatically handled