-
Notifications
You must be signed in to change notification settings - Fork 6
implement a tool to resolve workspace symbols based on a query #79
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
Conversation
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. |
@visibleForTesting | ||
static final resolveWorkspaceSymbolTool = Tool( | ||
name: 'resolve_workspace_symbol', | ||
description: 'Resolves a given symbol or symbols in a workspace.', |
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.
does this need to be more descriptive for an LLM to know what this does? This reads like only someone familiar with static analysis will understand what this tool does.
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.
So, I was wondering about that but I have tried a few different prompts and it seems to understand. I think the LLM was trained on enough people familiar with static analysis that it actually "understands" this prompt well?
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.
I updated this a bit, PTAL
|
||
@visibleForTesting | ||
static final resolveWorkspaceSymbolTool = Tool( | ||
name: 'resolve_workspace_symbol', |
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.
same question WRT the tool name. Should this be understandable by a human trying to decide whether to approve or deny the use of this tool?
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.
With the newest API version there is an additional field called "title" so I could add a user friendly title under there?
We should probably do this to all the tools
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.
Added tool annotations to give it a better name, PTAL
description: 'Resolves a given symbol or symbols in a workspace.', | ||
inputSchema: Schema.object( | ||
properties: { | ||
'query': Schema.string(title: 'The query for the symbol(s) to look up'), |
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 not clear to me what the query will look like. How will the LLM know what this should look like? Can we add an example in comments here too?
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.
The LSP spec doesn't have any sort of definition I could find, cc @bwilkerson who might know what is actually supported?
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.
As far as I can tell, this just does a "fuzzy match" by exact name. So it allows for typos but not any sort of patterns or path queries.
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.
Added a description after talking with Danny and Brian, PTAL
This allows you to ask things like "Tell me about in my project" and it will tell you where it is located.
Follow on features will allow for looking up more detailed information about the symbol such as its doc comments and API.