-
Notifications
You must be signed in to change notification settings - Fork 395
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
Additional interface for a proofreading tool #1698
Comments
The proposal needs further re-thinking. For the time being, I close the issue, hoping that this is OK. |
First, sorry for the delay in responding!
I'm generally very positive to this!
I am not quite sure what you mean with "restricted to a one-liner". Do you mean the entries in the quickfix window, or the error messages from the "linter tool" that are parsed through the In general, I think you should parse so that each entry in the quickfix list has i) a line number and possibly column number to specify location of error, ii) an error message that explains the error.
Both yes and no. I try to add tests for the various features of vimtex, but not all features are properly tested. I'll accept and merge a PR for this feature even if it does not have automated tests, of course, but adding automated tests would of course be even better. Note, though, that we then need to handle the install of both LanguageTool and your YaLafi. As a first step, I would say it is sufficient to provide a good example of the feature with a good LaTeX sample and a minimal vimrc file so that we can manually test the feature.
Yes, the docs should be updated accordingly with an explanation of the feature and how to use it. Here one could also suggest how to set up Ale for an "improved" version with more highlighting and automatic linting.
Yes, these should be available when you start the compiler. I think it is safe to use them in a compiler plugin. Both objects are defined on initialization. Note, though, that the
No problem. I'll be happy to consider this feature when you are ready! |
No problem. I really appreciate that you invest the time and reply that carefully.
I mean the following problem: For each detected mistake, we can provide a certain amount of information. This is not only the explanatory error message itself, but also a list of replacement suggestions from the proofreader (often useful) and the error context as seen in plain text by the proofreader. The latter may be helpful if the LaTeX filter performed some more aggressive modifications, e.g., when handling equations. All this together may form a quite "long line" for each reported problem, and this may become confusing, even if one uses the error list in the separate quickfix window ( The (My concerns probably have the following root. In all other plugins like ALE, one can display a subwindow that shows all information in a structured manner. Here, we only have a one-liner in the status line, or a wrapped line in the quickfix window.)
Thanks again. This seems to become a larger project that back-stimulates the LaTeX filter quite substantially. |
Yes, I think you understand the errorformat and quickfix window feature properly.
Yes, the way you describe it makes me think we sort of want two variants of this feature:
I believe ALE in part (or fully) supports the second variant, including the abillity to apply "fixes" (see |
PR #1714 proposes a new vimtex compiler named vlty. I'm unsure about (at least ;-) the following points.
Simple example A vimrc could contain:
Here, the With input
we get on
EDITS |
Do you mind if I reply to this comment in #1714 and that we close this issue? It would be easier to have the discussion in a single thread. |
I've taken the liberty of doing just this. |
That's fine for me, too. |
Following the discussion in Issue #1864, I'd like to propose a further vimtex compiler interface to LanguageTool. Similarly to the interface via TeXtidote, see
vimtex-grammar
, it extracts plain text from the LaTeX source before invoking the proofreader. A prototype of the new component is described here. Depending on the nature of the LaTeX document, it may provide better flexibility and less false positives.Before progressing, some things would have to be clarified.
errorformat
mechanism is restricted to a one-liner. What should be included? In the version above, it only contains LanguageTool's "Message" part, but rule ID and replacement suggestions are useful and can be easily added. This will often produce long one-line messages, and might be configured by Vim variables.(2nd edit:) Perhaps, one could somehow use the idea in Issue #28@YaLafi?
(last edit for now:) The vimtex code includes the two objects
b:vimtex.documentclass
andb:vimtex.packages
. If they are accessible when starting the "compiler", we can possibly achieve a nice integration.The text was updated successfully, but these errors were encountered: