Closed nikhilmaddirala closed 8 months ago
Same for me on Mac 0.9.1 version
It seems like a breaking change from logseq. I'll take a look
Same problem here in Windows 11.
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)
Whilst all the other menu options work, when I try the "Edit current page" option
VS Code opens showing the following error:
The current page is opened in VSCode without an error
It looks like its trying to open an absolute path - /pages/Note.md
without including the full path to the graph folder.
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
FWIW, you can manually patch the fix from https://github.com/rebornix/logseq-open-in-code/pull/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
Thanks that works!
On Thu, 15 June 2023, 3:20 am David Laing, @.***> wrote:
FWIW, you can manually patch the fix from #8 https://github.com/rebornix/logseq-open-in-code/pull/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("logseqlocal", "") + "/" + t[0][0]):null}Disable / enable the "Open in VS Code" plugin for the changes to have an effect
— Reply to this email directly, view it on GitHub https://github.com/rebornix/logseq-open-in-code/issues/7#issuecomment-1591692933, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF5V4HIV5MWCZEMH7PPKQQ3XLHXE7ANCNFSM6AAAAAAWVT572M . You are receiving this because you commented.Message ID: @.***>
@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?
In theory the next time the plugin is updated this "manual" patch will just get overwritten.
Hi, I'm getting this error when trying to open current page (titled "logseq-gtd") in VS Code
Still broken in mid July. Windows 11.
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.
Fixed now via https://github.com/rebornix/logseq-open-in-code/pull/9
0.0.7 has the fix released, thanks!
Hi, I'm getting this error when trying to open current page (titled "logseq-gtd") in VS Code