tecosaur / LaTeX-Utilities

An add-on to LaTeX Workshop that provides some features that go beyond the bare essentials
MIT License
482 stars 28 forks source link

Fixes to make sure that everything works fine with reverted commit from LaTeX-Workshop. #348

Closed leoleoasd closed 2 years ago

leoleoasd commented 2 years ago

This PR contains fixes to make sure that everything works fine with leoleoasd/LaTeX-Workshop@ea05a444e0e6a63d4b29d61b9d531f4905d2b0c7.

I'm volunteering myself to continue to maintain this repo. I've made some changes, and after everything works fine I'll contact people from LaTeX-Workshop to re-add support for this project.

I've sent an email to you (tec#tecosaur.com) to answer some of your concerns from #347.

todo list:

closes #347

tecosaur commented 2 years ago

Hi Leo, thanks for the PR. I notice a console.log() that looks like it may be accidental, but other than that this looks good.

You've also prompted me to look at my emails, looks like you ended up in my spam folder :( that should be resolved now though.

leoleoasd commented 2 years ago

The tsc compiler complains about got a lot, and I'm not familiar with it. I've replaced it with axios which I am more familiar to. I verified that Zotero integration works like a charm.

As for tikz picture previewing, the command viewtikzpicture complains that range(see this line) is undefined. Clicking view tikz picture which is shown above \begin{tikzpicture gave the following error:

Cannot read property '/VAR/FOLDERS/27/YM8Q81CJ3K7GMJ317J3R7SF00000GN/T/VSCODE-LATEXUTILS/TIKZPREVIEW-EXP-REPORT-DX37XY/TIKZPICTURE-41092352.PDF' of undefined

Still investigating.

leoleoasd commented 2 years ago

Clicking view TikZ picture is working now 🎉

@tecosaur Does manually invoke the viewtikzpicture command used to work, or it is only intended to be invoked at clicking the view TikZ picture prompt? It seems that the callback for registerCommand in vscode api has no parameters.

leoleoasd commented 2 years ago

It seems that the parameters are passed in CodeLens. Should we give a prompt to tell uses that manually invoking the preview command isn't supported?

tecosaur commented 2 years ago

That could make sense. The only intended use is clicking the "View TikZ picture" code lens.

leoleoasd commented 2 years ago

Sadly, people from the Workshop refused to add support. I'm moving the necessary code from the Workshop to provide these features, but this takes time. The Workshop is licensed under MIT, so using their code seems fine.

tecosaur commented 2 years ago

@leoleoasd have you approached the LaTeXWorkshop team about the prospect of adding support back?

leoleoasd commented 2 years ago

@tecosaur see James-Yu/LaTeX-Workshop#3057

tecosaur commented 2 years ago

Thanks for the link.

Huh, that's a bit of a pain. I'm not sure what the "maintenance burden" in just exposing a few functions is, but at the end of the day it is their call.

leoleoasd commented 2 years ago

I'm fine with "maintenance burden", for example, we do use some of their features marked @deprecated. Though I think this can be overcome, for example, I've changed the exposed function on their side to use the new API. However, they still believe that support should not be added.

I'm working on moving the necessary code.

tecosaur commented 2 years ago

Did you mean to merge this instead of closing it?

tecosaur commented 2 years ago

Ah, I take it #349 supersedes this.

leoleoasd commented 2 years ago

Did you mean to merge this instead of closing it?

I've opened a new pr to track the status of removing the dependency. This branch requires my fork of Workshop, so I think it's better to not merge this into master.