-
Notifications
You must be signed in to change notification settings - Fork 15
Optimize outline for python #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Another example:
At the moment it is only outputted as:
This will not give the necessary context. It also needs the attributes for such objects. Ideally:
For languages like python with less type-safety and integrated extensive doc-strings, instructions how to write code, that can be interpreted properly, would be useful. |
I'm also reluctant to modify the base tags files. They mostly come from the language parser repos and are written by tree-sitter experts who are using it actively. I'd rather not second guess their implementations. I did start work on a way for the LLM to ask for a specific class/function definition if it wants to see it (instead of the entire file), and that involves creating new query files which require some work to figure out. I'm not sure how easy/hard that is going to be to maintain when the parsers change. Wonder if you think that's a useful feature? I'll take a crack at 1 and let you know how that's working out. |
@TechupBusiness I couldn't find a clean way to get the full python declaration into the outline. I'll try something hackier next, that uses (possibly non-tree sitter) language specific code. I just wanted to let you know that I have added an MCP implementation fetcher to work with the MCP outliner. The LLM can now fetch the full definition of any function etc. from the outline by asking for it by file and function name. No need to read the whole file into context. Since you're using the outline feature, just wanted to get your feedback on it. Works for all supprted languages except C/C++ (their tags files don't support the right structure). This endpoint was added in v0.2.14 published today. |
Sorry that I couldn't test it properly yet. I didn't forget it. |
@TechupBusiness no worries. I haven't forgotten this issue. I'll put some time into this project over the next few days. Hope to get to this issue as well (I have some ideas on how to do it in a clean way). |
I used the outlines method to create information about python code.
Looks like some methods are cut off like
test_init_encryption_new_password
:I would suggest a simpler syntax:
And ideally it could also read the doc-strings in python (Docstrings are a specific type of comment in Python used to document code). This can give the LLM important context (for example return object structures could be described in the comments etc). According to a quick research with Grok, Treesitter should be able to do this. Example for output:
The text was updated successfully, but these errors were encountered: