Open Catya3 opened 1 month ago
Actually compiler embeds stdlib source code so that could help, but that's just bytes
One way to implement this could be compile stdlib on the fly and then query it as an object, it's not hard do to
However, other issue is that after parsing we don't have comments in the source code objects.
Another way is not to parse it at all and instead just implement some text search. However that won't be as good as Go's go doc
cmd where you can actually query stuff by package and entity.
And the most important question - how frequently are you using this feature in other languages? I personally never use it :D I always go to docs or some third-party web-sites including google and chatGPT
This is my dev workflow right now:
$ grep -rE Range $HOME/neva/std
/home/$USER/neva/std/builtin/core.neva:pub component Range(from int, to int) (data stream<int>)
I could at least wrap up grep
so that you can add a package name with path/to/package . Symbol
which would get translated to:
grep -rE Symbol $HOME/neva/std/path/to/package
We could build this first and use it to build the autogenerated docs? We could do it like this
and then have neva doc
at least until we can finish a auto generated documentation
As a prototype I can expect something that loads stdlib into an index and allows searching for keywords like
grep
, while displaying a few lines of context. The inverted index can be stored somewhere under $HOME/Neva directory.