gutter-preview icon indicating copy to clipboard operation
gutter-preview copied to clipboard

mapping the gutterpreview paths failed

Open treemoons opened this issue 4 years ago • 13 comments

About mapping to be computed relative to project root .

I put settings like "gutterpreview.paths":{"~/":"${workspaceRoot}/MyPersonalWeb/wwwroot" } however it didn`t work. still default display instead of which being set

could you take an example for me?

treemoons avatar Apr 10 '20 05:04 treemoons

Iit doesn't work becaise variable resolution is not done for settings (there is no API for it right now, see https://github.com/microsoft/vscode/issues/46471).

I suggest to simply use gutterpreview.paths":{"~/":"MyPersonalWeb/wwwroot/" }, as workspace root based resolution is done on top of the alias resolution, this should resolve the issue.

kisstkondoros avatar Apr 11 '20 20:04 kisstkondoros

Iit doesn't work becaise variable resolution is not done for settings (there is no API for it right now, see microsoft/vscode#46471).

I suggest to simply use gutterpreview.paths":{"~/":"MyPersonalWeb/wwwroot/" }, as workspace root based resolution is done on top of the alias resolution, this should resolve the issue.

Thanks for your answer .I try this ,but it still didn`t function. image

treemoons avatar Apr 13 '20 08:04 treemoons

My bad it should have been

gutterpreview.paths":{"~":"MyPersonalWeb/wwwroot/" }

Let me know if this worked, I've just tested the setup locally, and it seems to be working fine. If the issue still persist, I'll reopen the ticket again :+1:

kisstkondoros avatar Apr 20 '20 20:04 kisstkondoros

nope it is still not working

kisstkondoros avatar Apr 20 '20 20:04 kisstkondoros

Ok so it seems to work :sweat_smile: , I've got confused because I had a path mapping to the src folder (which is the default additonal source folder).

TLDR; Should work with gutterpreview.paths":{"~":"MyPersonalWeb/wwwroot/" }

kisstkondoros avatar Apr 20 '20 20:04 kisstkondoros

Ok so it seems to work 😅 , I've got confused because I had a path mapping to the src folder (which is the default additonal source folder).

TLDR; Should work with gutterpreview.paths":{"~":"MyPersonalWeb/wwwroot/" }

I am in the puzzled about this,it didn`t work even after reopened ,still!😣 Could you show your strcut of folder tree or seek the mistake which I made. Big thanks to you.

image

The following is the sreenshot of my folder .

image

treemoons avatar Apr 21 '20 08:04 treemoons

I have to check this in more detail. Sorry, I've totally forgot about this :(

kisstkondoros avatar May 29 '20 14:05 kisstkondoros

So, today I've checked it with https://github.com/TreeMoons/Moons and the mentioned configuration option "gutterpreview.paths": { "~": "MyPersonalWeb/wwwroot/" }. I'm not sure why it doesn't work for you, but it worked for me for the first try...

I've also updated all dependencies in the meanwhile, perhaps that helped too...

I'm wondering if there is something else causing some issues... Are there any specialties in your workspace / system configuration?

Please give it another try with the new version ([email protected])

kisstkondoros avatar Jun 01 '20 22:06 kisstkondoros

Thank you,although this isue isn’t solved for me.

updated new version, aslo failed.

I use some configuration like:


    "path-autocomplete.triggerOutsideStrings":true,
    "path-autocomplete.pathMappings": {
        "~": "${folder}/MyPersonalWeb/wwwroot",
        "/": "${folder}",
        "$root": "${folder}/MyPersonalWeb/wwwroot", 
    },

yes ,I try to delete my configuration above,and restart ,however,it' s failed as well.

configration:

 "gutterpreview.paths": {
        "~": "MyPersonalWeb/wwwroot/"
    }

my project file at “MyPersonalWeb/Views/Home/Index.cshtml”

   <img src="~/src/img/logo.png" alt="">    @* unworked*@
  <img src="../../../MyPersonalWeb/wwwroot/src/img/big.jpg" alt=""> @* worked*@

It is a big problem that I don't kown where the problem happened.

treemoons avatar Jun 02 '20 04:06 treemoons

Thank you,although this isue isn’t solved for me.

updated new version, aslo failed.

I use some configuration like:

    "path-autocomplete.triggerOutsideStrings":true,
    "path-autocomplete.pathMappings": {
        "~": "${folder}/MyPersonalWeb/wwwroot",
        "/": "${folder}",
        "$root": "${folder}/MyPersonalWeb/wwwroot", 
    },

yes ,I try to delete my configuration above,and restart ,however,it' s failed as well.

configration:

 "gutterpreview.paths": {
        "~": "MyPersonalWeb/wwwroot/"
    }

my project file at “MyPersonalWeb/Views/Home/Index.cshtml”

   <img src="~/src/img/logo.png" alt="">    @* unworked*@
  <img src="../../../MyPersonalWeb/wwwroot/src/img/big.jpg" alt=""> @* worked*@

It is a big problem that I don't kown where the problem happened.

hi,did you resolve the problem?

Minori-ty avatar Sep 10 '21 05:09 Minori-ty

Thank you,although this isue isn’t solved for me.

updated new version, aslo failed.

I use some configuration like:

    "path-autocomplete.triggerOutsideStrings":true,
    "path-autocomplete.pathMappings": {
        "~": "${folder}/MyPersonalWeb/wwwroot",
        "/": "${folder}",
        "$root": "${folder}/MyPersonalWeb/wwwroot", 
    },

yes ,I try to delete my configuration above,and restart ,however,it' s failed as well.

configration:

 "gutterpreview.paths": {
        "~": "MyPersonalWeb/wwwroot/"
    }

my project file at “MyPersonalWeb/Views/Home/Index.cshtml”

   <img src="~/src/img/logo.png" alt="">    @* unworked*@
  <img src="../../../MyPersonalWeb/wwwroot/src/img/big.jpg" alt=""> @* worked*@

It is a big problem that I don't kown where the problem happened.

hi,did you resolve the problem?


No,I abandoned it ! :(

treemoons avatar Sep 10 '21 05:09 treemoons

I solved this problem by replacing "@" with "$". Something like this:

"path-autocomplete.pathMappings": {
	"$img": "${folder}/src/img"
},
"gutterpreview.paths": {
	"$img": "img"
},
"gutterpreview.enableReferenceLookup": true

heycisco avatar Jan 27 '22 07:01 heycisco

I solved this problem by replacing "@" with "$". Something like this:

"path-autocomplete.pathMappings": {
	"$img": "${folder}/src/img"
},
"gutterpreview.paths": {
	"$img": "img"
},
"gutterpreview.enableReferenceLookup": true

it don't work :(

Minori-ty avatar Jun 16 '22 12:06 Minori-ty