Closed edmundo096 closed 2 years ago
Could you add example of the path and workspaceRelativeDirectory value for it ?
+1 It would also be great to have other "relative" placeholder tokens, like fileRelativePath.
For example, if in CMD I want to copy the file to another path, I would like to save the relative path to that file. Currently, I can't.
@VovanNet Sure.
What we mean for a fileDirRelativePath
(or fileRelativePath
as @igor-sirotin suggested) is the file's relative path to the workspaceRoot
.
For example, having:
workspaceRoot: d:\projects\foo-proj
file: d:\projects\foo-proj\src\app\app.component.ts
fileBasename: app.component.ts
fileBasenameNoExt: app.component
fileExtname: ts
fileDirname: d:\projects\foo-proj\src\app
fileDirRelativePath
could be:
fileDirRelativePath: src\app
Also, off-topic and personal thoughts but I could suggest the following renames.
Those are based a bit from the IntelliJ IDEs variables https://stackoverflow.com/questions/44802832/phpstorm-template-variables-documentation
current -> new
------------------------------------
workspaceRoot -> workspacePath // d:\projects\foo-proj
file -> filePath // d:\projects\foo-proj\src\app\app.component.ts
fileBasename -> fileName // app.component.ts
fileBasenameNoExt -> fileNameNoExt // app.component
fileExtname -> fileExt // ts
fileDirname -> fileDirPath // d:\projects\foo-proj\src\app
fileDirRelativePath // src\app
Ok, we will add these variables soon
@edmundo096 @igor-sirotin Hello! We have added a "workspaceRelativeDir" relative placeholder. More details in the README.md. If you have any other wishes - write, be sure to take note. Thanks)
I'm trying to follow https://stackoverflow.com/a/58429096/2012945 but a placeholder token for a possible "workspaceRelativeDirectory" path is missing.
Hopefully it isn't too much different from what the extension have of the workspace info internally so this token can be easily added.