Closed martinhoess closed 1 year ago
try in latest version, you can using all variables defined in https://code.visualstudio.com/docs/editor/variables-reference
thanks for the update, but unfortunately I can't get it to work simple test should open windows explorer with the current dir, it opens the explorer but always with user/documents
I've also tried other apps but at least the directory variables do not seem to work
{
"extensionName": "*",
"apps": [
{
"title": "Explorer",
"openCommand": "Explorer.exe",
"args": ["/root,${workspaceFolder}"]
}
]
}
@martinhoess try the latest version with settings like:
"openInExternalApp.openMapper": [
{
"extensionName": "*",
"apps": [
{
"title": "Explorer",
// shell command combined with placeholder
"shellCommand": "Explorer.exe /root ${workspaceFolder}"
}
]
}
]
@tjx666 seems to work
I've also tried to combine 2 placeholders which also works ${fileWorkspaceFolder}\\${relativeFileDirname}
Only thing, in the example you posted there is a , missing between root and $ which is necessary
"shellCommand": "Explorer.exe /root,${workspaceFolder}"
${fileDirname}
does somehow not work for stuff outside the working project but if the file is inside the working project it works
but ${file}
works for both (inside and outside working project)
I can't reproduce it:
Does that path contains space? If file path contains space, you may need to wrap it with quotes.
{
"extensionName": "ts",
"apps": [
{
"title": "run ts file",
// wrap with quote
"shellCommand": "ts-node '${file}'"
}
]
}
no none of the path or filenames contains spaces. Like I said, it has to do if the opened file is part of the opend folder or not.
given folder structure:
C:\test\subfolder\project\ with a project.txt inside the "project" folder and a test.txt inside "test" folder
then in VSCode file -> open folder -> open C:\test\subfolder\project\ then from within VSCode explorer pane open the porject.txt and then via file -> open file -> open the test.txt
then with this setting
"openInExternalApp.openMapper": [
{
"extensionName": "*",
"apps": [
{
"title": "Explorer",
// shell command combined with placeholder
"shellCommand": "Explorer.exe /root,${fileDirname}"
}
]
}
],
try to open the project.txt and test.txt externally Folder of project.txt is opened correctly Folder of test.txt is not opened correctly (instead the user document folder is opended)
if you do the same but open folder "C:\test\" then it works fine for both files
I hope this helps somehow
@martinhoess please test the latest version
latest version looks good! thank you!
Is there a var/placeholder for the current file name(s) which can be used in the args settings? I have a special application which for which the file parameter must be at a certain position
Edit: since it was marked as enhancement: