-
Notifications
You must be signed in to change notification settings - Fork 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
Add navigation commands into the editor #5
Conversation
Hey @xingyaoww, I think this PR is mostly ready. Some remaining issues I'm not sure how to handle properly yet:
|
Is there a way for us to create this directory elsewhere? Say something under
Hmm interesting, can you point me to the exact code for this? I'm thinking we could potentialy track back from an model given path? |
Yeah thanks for the idea, I think we can do this.
Below is the code, I looked into command output in the trajectory and seems like when the openhands-aci/openhands_aci/utils/file.py Lines 8 to 35 in 46ddee5
|
@xingyaoww I figured out a way to handle the workspace thing, thanks to the pwd already set to bash pwd for ipython. This should be finally ready. Please take another look, then I'll cut a release and finish up the PR in OH repo. |
query = ts_language.query(tags_query) | ||
captures = query.captures(parsed_tree.root_node) | ||
|
||
parsed_tags = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you call it tags
? Seems a bit confusing? Is it just node
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a term in tree-sitter
when using query files, the output can be called tag, which is just a named entity, or syntax node: https://tree-sitter.github.io/tree-sitter/code-navigation-systems
lmk when this is ready for another look! |
Close this in favor of #35. |
Description
This PR is to add navigation commands into the editor:
jump_to_definition
find_references
The 2 commands will be enabled when detecting a git repo in cwd. Otherwise, it will print:
Also, if the navigator commands are enabled, when the agent
view
s a file, the content is also appended with to encourage exploration. If no git repo found the TIP will not be appended.How Has This Been Tested?
symbol-navigator.1.mov