Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path does not exist #7

Closed
nikhilmaddirala opened this issue Apr 6, 2023 · 13 comments
Closed

Path does not exist #7

nikhilmaddirala opened this issue Apr 6, 2023 · 13 comments
Assignees

Comments

@nikhilmaddirala
Copy link

Hi, I'm getting this error when trying to open current page (titled "logseq-gtd") in VS Code
image

@adxsoft
Copy link

adxsoft commented Apr 7, 2023

Same for me on Mac 0.9.1 version

@rebornix
Copy link
Owner

It seems like a breaking change from logseq. I'll take a look

@rebornix rebornix self-assigned this Apr 11, 2023
@compadrejunior
Copy link

Same problem here in Windows 11.

@mrdavidlaing
Copy link

Same for me, with versions:

Open in VS Code: v0.0.5
OS: Mac OS 13.4 (22F66)
Logseq: 0.9.8 (0.9.8)
VS Code: 1.78.2 (Universal)

What happens

Whilst all the other menu options work, when I try the "Edit current page" option
image

VS Code opens showing the following error:

image

What I expect to happen

The current page is opened in VSCode without an error

Ideas

It looks like its trying to open an absolute path - /pages/Note.md without including the full path to the graph folder.

@adxsoft
Copy link

adxsoft commented Jun 13, 2023

Unfortunately this issue (a showstopper) is still not working after several months despite a PR with the fix being submitted.
I understand the developer probably is busy but it would be appreciated by many logseq users if the PR could be integrated and the plugin re-issued.

This is such a useful plugin and its a shame not to be able to use it anymore.

TIA

@mrdavidlaing
Copy link

FWIW, you can manually patch the fix from #8 into ~/.logseq/plugins/logseq-open-in-code/dist/assets/index.64104ec8.js by replacing:

async function Ai(e){const t=await logseq.DB.datascriptQuery(`[:find ?file
                :where
                [?b :file/path ?file]
                [(== ?b ${e})]
            ]`);return t&&t.length>0?t[0][0]:null}

with

async function Ai(e){const graph = await logseq.App.getCurrentGraph(); const t=await logseq.DB.datascriptQuery(`[:find ?file
                :where
                [?b :file/path ?file]
                [(== ?b ${e})]
            ]`);return t&&t.length>0?(graph.url.replace("logseq_local_", "") + "/" + t[0][0]):null}

Disable / enable the "Open in VS Code" plugin for the changes to have an effect

@adxsoft
Copy link

adxsoft commented Jun 15, 2023 via email

@sindoc
Copy link

sindoc commented Jul 2, 2023

@mrdavidlaing Thanks for patching it here. If we make the change, as you describe it here, will it be safe after the potential future updates?

@mrdavidlaing
Copy link

In theory the next time the plugin is updated this "manual" patch will just get overwritten.

@notuntoward
Copy link

Hi, I'm getting this error when trying to open current page (titled "logseq-gtd") in VS Code image

Still broken in mid July. Windows 11.

@e-zz
Copy link
Contributor

e-zz commented Aug 13, 2023

Hey guys, I just published a patched release here.
Now you could manually reload from logseq the content in the released zip file to make it work.

And I also added two shortcuts for editting pages or graph folder in vscode. Check the plugin setting and change these shortcuts if you want.

@rebornix
Copy link
Owner

Fixed now via #9

@rebornix
Copy link
Owner

0.0.7 has the fix released, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants