James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.55k stars 522 forks source link

Citation issues highlight the whole paragraph, not the error #4181

Closed dskinnion closed 6 months ago

dskinnion commented 6 months ago

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • [x] The feature request has not been suggested in this repository.

The Missed*

Is your feature request related to a problem? Please provide a clear and concise description of what the problem is.

  • Currently, an error with citations or references will highlight a whole paragraph (or line, which may be wrapped into a paragraph). This makes it difficult to know which citation is throwing the actual error.

The Solution*

Please provide a solution you would like to have.

  • Instead, it should just highlight the single error.

Anything Else?

Add any other context about the feature request below.

  • Thanks!
jlelong commented 6 months ago

That would be indeed be really helpful. The main difficulty comes from the poor error/warning messages of LaTeX related tools. At best, they provide the line number of the error but certainly not the column number. To better localize the error, we would need to search for the culprit reference inside the line ourselves. Although I find the idea interesting, I am not sure when we may the time to implement it.

@James-Yu Maybe we could factorize some with the reverse synctex refinement already implemented in LW. What do you think?

James-Yu commented 6 months ago

What confused me is that what I looked into #4168 , I cannot find the reverse synctex column locating code. Same as you, I recalled that we do have such code, but they disappeared from the code base in the past a few versions.

As to the feature request itself, it should not be too hard, just need some time to implement.