-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: add LaTeX parser #100
Conversation
Just a random thought, if anyone would find it of interest: I've already written a little bit about things like grammar checkers and LSPs in the VimTeX docs. If and when this PR is finished and merged, I think it could be of interest to the community that I also mention Harper as a possible tool for spell and grammar checking (for the English language). I think it should be mentioned under |
Update: This is mostly functional, but does not treat macros in paragraphs correctly. |
…arper-comments and harper-ls
Credit: Elijah Potter <[email protected]>
To anyone waiting on this, sorry for the lack of progress, LaTeX is such a weird language, and nvim-treesitter itself sometimes has trouble. The biggest issue is considering the inputs to macros as separate sentences, and giving lints about capitalization. |
No worries, take your time. It's no surprise, really! 😅 |
Note, this isn't actually closed, but I moved it to a branch of the main repository instead of my fork. Not sure I can edit the PR to reflect that though. |
I'm trying to use harper with typst and would consider contributing support for it. Could your work for latex (which has a similiar use-case) be expanded to that? If not, please link the new PR/branch, maybe I can figure out how to build it from there. |
@pinpox The typst syntax is very different than latex syntax, though, isn't it? |
Yes, it is more similar to markdown. typst has treesitter and LSP support though, which if I understand correctly are used for Latex support implementation. I suppose it would be a matter of just interfacing with a different treesitter grammar to extract text parts, but I might be wrong. |
Thankfully, Typst is written in Rust, so the folks over there have already done the work of creating a parsing crate that we can interface with, which is a lot simpler than using the treesitter implementation. LaTeX in particular is tough because of macros, which are expanded at compile-time, so we can't know how a piece of text is expanded just through grabbing every text node from treesitter. |
No description provided.