mihai-vlc / path-autocomplete

Path autocomplete for visual studio code.

Home Page:https://marketplace.visualstudio.com/items?itemName=ionutvmi.path-autocomplete

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow `./` to refer to project root folder

fisher-j opened this issue · comments

I would like to be able to use ./ to access project root folder, ie.: to have the same functionality as /.

The problem is on windows, using R, / is interpreted as the system root, and so using this in my path strings doesn't resolve to project folder, whereas ./ does resolve to my project folder.

When I try:

"path-autocomplete.pathMappings": {
    "./": "${root}"
},

then ./ doesn't trigger anything.

${root} is not a valid placeholder.

Can you please try with ${workspace} or ${folder} ?

Yes. Using ${workspace} or ${folder} in the mapping above causes "./" to map to the parent directory of my current workspace, instead of the workspace itself.

Can you try to post an example folder structure and the expected result when you try to run "./" from a subfolder ?
I can try to reproduce it on my side.

c:/
  user
    .profile
    recyclebin
    myprojectfolder  <-- current vscode workspace folder
      data
        dataset1.csv
      example1
        analysis.rmd  <-- current file

When working on analysis.rmd with vscode opened with myrojectfolder, if I type"./", I get: .profile; recyclebin.

The desired result is that "./" should give data; example1 when I have the following setting:

"path-autocomplete.pathMappings": {
    "./": "${folder}"
},

Currently, "/" gives the expected result, but I can't use it because on windows it is interpreted as the system root: c:/. Basically I just wan to be able to use "./" to refer to the workspace folder instead of "/".

Interestingly, once I type "./data/", including the trailing slash, the only suggestion is dataset1.csv, which is the desired target.

try like this

 {
     "path-autocomplete.pathMappings": {
         "./": "${folder}/"
     }
 }

i will have a look during the next few days to remove the need for that traling slash