Open devgid opened 8 months ago
Will have a look. Txs
Unfortunately, it's not something that can be fixed. The API design of VSCode has a flaw. It does not allow you to map a document-derived tab (e.g. preview, pdf-renderer) to the file that was used as a source for that tab. As far as VSCode API goes it simply says there is no active editor at the moment:
I found this post, which triggered this discussion. The problem was highlighted in 2018 but VSCode team closed it in 2020 without addressing the file name aspect of it. I can't see how we can even have a workaround.
The only thing that I can do is to explain the problem better in the error message:
@oleg-shilo Thanks for the explanation. Is it possible to add an "add to favorites" open in the context menu when right clicking on a file. This is how the another favorites extension I tested does it which works with epub and pdf files.
This is the favourite extension https://marketplace.visualstudio.com/items?itemName=kdcro101.favorites and the right context menu:
Definitely. It means that the author of this extension has found a way to overcome this limitation. If indeed it is the case then it can be done even for the existing "add" button. Will have a look.
Done: Update the extension and you will be able to add the file via the context menu of the tab.
I have vscode-pdf extension to read pdf files and epub reader extension to read epub files.
When I click the bookmark icon on any of these type of open files (pdf or epub) I get the following error
If I right click on the file, copy path and paste the path into the extension's list text file manually, then the bookmark shows in the extension.