infi-pc / locatorjs

https://www.locatorjs.com
1.31k stars 60 forks source link

Locator JS not working in Mac with vs code #127

Closed devhiteshk closed 9 months ago

devhiteshk commented 10 months ago

Bug in Browser Extension

Chrome and Firefox Locator.js was working fine previously but has now stopped functioning.

Path: vscode://file/${projectPath}${filePath}:${line}:${column}

error: user gesture required

I am able to see the components on press of command + click but doesn't take me inside vs code, previously it was working fine.

pavleciric89 commented 10 months ago

linux ubuntu as well

niravj-pasvtechnologies commented 10 months ago

For me, I am being taken into vscode but file is not being opened.

abhay0480sharma commented 10 months ago

or me, I am being taken into vscode but file is not being opened.

abhay0480sharma commented 10 months ago

its a vs code latest version problem [Version 1.84] locator js not working but in 1.83.1 its working fine

abhay0480sharma commented 10 months ago

its a vs code latest version problem [Version 1.84] locator js not working but in 1.83.1 its working fine

Mrsebastino commented 10 months ago

I have a similar issue. It takes me to VSCode, but only to the files i have currently open. If i copy the path from from the locator and paste it in VSCode, it find the files.

joelbqz commented 10 months ago

Had to downgrade VSCode to 1.83.1 and worked well: https://code.visualstudio.com/updates/v1_83

antopolskiy commented 10 months ago

I've found a likely cause and a temporary fix that worked for me:

The link generated by LocatorJS looks like this vscode://file//.... Seem that VSCode now wants the link to only be vscode://file/..., and in fact if you copy the link generated by LocatorJS and remove one /, it works.

So my solution was to switch from default VSCode settings to Custom link in the LocatorJS options. However, when I did that, I noticed that it already has only 1 / after file. But it seems that internally LocatorJS adds another slash after file (maybe a bug? or perhaps ${projectPath} has a slash in front of it) and I had to remove all slashes after file for the custom link to be generated properly in the form vscode://file/.... Here are my final settings:

image

This now properly opens VSCode on the correct line. However, right now I have the issue that VSCode keeps asking me if I want to open the link, even though I mark "Allow opening links without asking". If someone has a fix for that, would be appreciated.

OmegaNalphA commented 10 months ago

The workaround listed here worked for me a little, but vscode keeps showing me a warning, even when I click "Allow opening local paths without asking image

zer0thbit commented 10 months ago

The workaround listed here worked for me a little, but vscode keeps showing me a warning, even when I click "Allow opening local paths without asking image

Simply tick the checkbox at the bottom.

zer0thbit commented 10 months ago

I've found a likely cause and a temporary fix that worked for me:

The link generated by LocatorJS looks like this vscode://file//.... Seem that VSCode now wants the link to only be vscode://file/..., and in fact if you copy the link generated by LocatorJS and remove one /, it works.

So my solution was to switch from default VSCode settings to Custom link in the LocatorJS options. However, when I did that, I noticed that it already has only 1 / after file. But it seems that internally LocatorJS adds another slash after file (maybe a bug? or perhaps ${projectPath} has a slash in front of it) and I had to remove all slashes after file for the custom link to be generated properly in the form vscode://file/.... Here are my final settings:

image

This now properly opens VSCode on the correct line. However, right now I have the issue that VSCode keeps asking me if I want to open the link, even though I mark "Allow opening links without asking". If someone has a fix for that, would be appreciated.

vscode://file${projectPath}${filePath}:${line}:${column}

infi-pc commented 9 months ago

I have merged https://github.com/infi-pc/locatorjs/pull/129, released an extension, and just released a new lib version with this fix. Thanks to all involved for checking.

Just a quick recap: It was caused by VSCode update, and the fix was to remove one / from the template URL to VSCode.

lzw10168 commented 8 months ago

image

vscode://file/${projectPath}${filePath}:${line}:${column}

This configuration in vscode 1.85.0, chrome 120, is fine

gabrielsoaresgsm commented 8 months ago

vscode 1.85.1 no longer works