rioj7 / command-variable

Visual Studio Code extension for variable substitution via ${command:commandID}
51 stars 10 forks source link

Multi-root Workspace Folder: Incorect path gennearation #2

Closed Qrylor closed 4 years ago

Qrylor commented 4 years ago

Using VS Code: Command Variable extension.commandvariable.file.relativeDirDots in launch.json for generating the a python module dot path.

If the WorskapceFolder is first in Workspace or is in a VS Code instance with just the open folder, ${command:extension.commandvariable.file.relativeDirDots}.${fileBasenameNoExtension}, generates the expected dot path.

If WorkspaceFolder is not first in Workspace, ${command:extension.commandvariable.file.relativeDirDots} returns "Unknown", showing error "File not in workspace folder"

I am unsure if this is an intended issue due to wanting to always reference modules from the first workspace when working in other Workspace(seems unlikely), or with how the workspace folder path is being generated. Glancing at the API and how it is behaving, my guess is folders[0].uri.path returns the first listed WorkspaceFolder path and not the files WorkspaceFolder.

All WorkspaceFolders are in the same root directory with .code-workspace path only referencing the folder name Environment: VS Code 1.39.2 Language: Python 3.7 OS: Windows NT x64 10.0.18362

rioj7 commented 4 years ago

Multi-root Workspace was on the ToDo list for this extension. I'll look into this.

rioj7 commented 4 years ago

@Qrylor : Try v0.8.0

Qrylor commented 4 years ago

Thanks for the quick response rioj7, kept meaning to thank you but kept forgetting to.