Skip to content
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

better initial prompt #7

Open
nikomatsakis opened this issue Jun 9, 2024 · 3 comments
Open

better initial prompt #7

nikomatsakis opened this issue Jun 9, 2024 · 3 comments
Assignees

Comments

@nikomatsakis
Copy link
Collaborator

The initial prompt right now is pretty bare bones. I want to try providing it better and more context. I'm going to do some experimenting, I suspect we can do this in a fairly language-agnostic fashion but I have to explore what APIs vscode offers me.

@nikomatsakis nikomatsakis self-assigned this Jun 9, 2024
@nikomatsakis
Copy link
Collaborator Author

From what I can tell, the only way to do what I want is to wrap the rust-analyzer language server (and presumably extension??). I had assumed it would be possible to ask vscode to do common operations (getDocumentSymbols) so that people could implement extensions that work across languages, but that doesn't seem to be true, at least based on what I see in the publicly documented API.

@nikomatsakis
Copy link
Collaborator Author

Examples of things I want to do:

  • Given the line on which the error occurred, find the extent of the current function so we can supply it for context.
  • Traverse the context of the error to find the public signature of functions that are being called, the definition of the types of the expressions, and so forth so we can include those in the context too.

@nikomatsakis
Copy link
Collaborator Author

OK, I've found that rust-analyzer returns a language client as part of its extension API. So by loading that I am able to get what I need, it seems, though so far it feels awfully clumsy (maybe I've not found the right vscode.d interface definitions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant