Spyglass icon indicating copy to clipboard operation
Spyglass copied to clipboard

General improvements to our hacky implementation of IMP-Doc

Open barraIhsan opened this issue 3 years ago • 7 comments

Try writing #> in the first of mcfunction file, then put some comment with capital letter image Then it will show up error

barraIhsan avatar Dec 11 '20 12:12 barraIhsan

The first line should only be the resource location of this function, according to the IMP-Doc.

SPGoding avatar Dec 11 '20 16:12 SPGoding

There are some examples on the wiki that show it is possible to start with a capital.

misode avatar Dec 11 '20 16:12 misode

There are some examples on the wiki that show it is possible to start with a capital.

Those examples are not for describing functions :eyes:

SPGoding avatar Dec 11 '20 16:12 SPGoding

tbh, I think it'd be cleaner to have syntax like this

#> storage namespace:main
# ....

For IML doc not describing functions ¯\_(ツ)_/¯

NeunEinser avatar Dec 11 '20 18:12 NeunEinser

I will keep this open to track general improvements to our IMP-Doc implementation :eyes:

SPGoding avatar Dec 11 '20 18:12 SPGoding

Sounds like the issue here in general is that people may not necessarily want to comply with the IMP-Doc header format when using the block comment style at the beginning of their function.

Maybe the solution is to check for a resource location and, if one exists, verify that it matches the current function location. Otherwise, if it fails to parse a resource location at all, just assume it's a regular comment header. (?)

Edit: or some kind of "strict IMP-Doc" toggle in settings (that's disabled by default)?

Edit 2: or... another comment prefix (like #!) that's used to indicate the function header, separate from the block comment (#>), and only recognized on the first line of the function.

Arcensoth avatar Dec 13 '20 20:12 Arcensoth