antonWetzel / typst-languagetool

LanguageTool Integration for Typst for spell and grammer check
MIT License
37 stars 9 forks source link

Checking `include`d files not working #21

Closed hbierlee closed 3 months ago

hbierlee commented 3 months ago

Hi,

Good tool!

From #17, it's indicated that your tool can check multi-file projects (where a main.typ uses include statement to include other files). For me, this doesn't seem to work at the moment (using an --extern-jar, not LSP, and for any combination of specifying root and main as CLI arguments):

> cat main.typ 
= Hello

this is an mistake

#include "sub.typ"
> cat sub.typ 

also an mistake

> typst-languagetool check --jar-location=languagetool.jar --main=main.typ --root=.

Checking Document

info[EN_A_VS_AN]: Use of 'a' vs. 'an'
 --> main.typ:3:9
  |
3 | this is an mistake
  |         -- info: Use <suggestion>a</suggestion> instead of 'an' if the following word doesn't start with a vowel sound, e.g. 'a sentence', 'a university'.
  |           - help: a
  | 

It seems to only be checking the main.typ, not sub.typ. Any idea what I'm doing wrong?

Cheers,

Henk

antonWetzel commented 3 months ago

I designed the API for Editor first and CLI second. At the moment you need to add --path=sub.typ to check sup.typ (and only sub.typ).

I am going to change the default behaviour to display all mistakes for CLI + Check + No Path.

hbierlee commented 3 months ago

Ok great! If multi-file projects with include statements are not supported for CLI, I'll try to set it up then for my editor, as I can't compile separate files in my larger project without breaking compilation.