slatex / sTeX-IDE

GNU General Public License v3.0
0 stars 0 forks source link

linter should spot "missing definitions". #19

Closed kohlhase closed 2 years ago

kohlhase commented 2 years ago

Sometimes the VoLL-KI UI cannot find definitions, as @Jazzpirate points out in https://github.com/slatex/sTeX/issues/362. So the linter should be able to predict this and give a warning so these can be fixed.

kohlhase commented 2 years ago

Just flagging {sdefinition} environments without a \defi* would go a long way.

Better still, flagging all \symdef and \symdecl* that do not have a \defi* in the module would be a great quality assurance feature.

Jazzpirate commented 2 years ago

this is tricky, since, since the \symdef and the \defi* occur in entirely different places and potentially even in different documents. Not something to be "quickly hacked", unfortunately :-/

Jazzpirate commented 2 years ago

Done

kohlhase commented 2 years ago

This is wonderful, but it still misses some "documentation". For instance \Definame.

Screenshot 2022-09-29 at 10 50 52
Jazzpirate commented 2 years ago

True, I forgot the "Definame"-case (pushed) - anything else it's missing?

kohlhase commented 2 years ago

The Definame problem is not (fully?) fixed yet with that push. The screenshot shows an instance. This might be an interaction between \Definame and ambiguous symbols?

kohlhase commented 2 years ago

apart from this, these warnings are a very useful feature, most of the (legitimate) ones seem to be due to symbols that have a \symdef without a name= and corresponding \symdecl* and thus easily fixed.

kohlhase commented 2 years ago

and t

The Definame problem is not (fully?) fixed yet with that push. The screenshot shows an instance. This might be an interaction between \Definame and ambiguous symbols?

and here the screenshot:

Screenshot 2022-09-29 at 12 11 33
Jazzpirate commented 2 years ago

Oh, but given ambiguity, this is correct. The Definame is for "poplanning?partial-order-planing", not for the above "poplan-process?partial-order-planning". In other words: the latter really is undocumented :)

kohlhase commented 2 years ago

Ah, you are right, thanks. Then that has to be fixed a different way than I thought.

kohlhase commented 2 years ago

But there is a related issue. There are some \symdefs that I do not WANT to define or document.

Is it possible to just add a key nodef to \symdef that can be used to express this?

kohlhase commented 2 years ago

For clarification these symbols are mostly in examples, and are the semantic macros used in representations there. An example of this is MiKoMH/AI/source/ planning/slides/strips-blocksworld.en.tex where I am not quite sure how to best flexiformalize this.

Jazzpirate commented 2 years ago

There are some \symdefs that I do not WANT to define or document.

I disagree. There are no symbols you do not want to be documented ;) Think of the documentation as "what students should see if they're confused by what this means".

The solution for strips-blocksworld could/would be to just add a [for={} to the already present sdefinition and list all predicates there. Or even better: wrap the sexample below in a {sparagraph}[type=symdoc,for={}] and put the predicates in there. Then that's what students get to see if they hover over the symbols.

Is it possible to just add a key nodef to \symdef that can be used to express this?

I don't think it a good idea to introduce stex-package functionality (such as keys in macros) for mere IDE linting aspects in general...

kohlhase commented 2 years ago

Ah, thanks. You are right.