fix autocomplete endpoints in web framework #2224#2299
Open
asukaminato0721 wants to merge 5 commits intofacebook:mainfrom
Open
fix autocomplete endpoints in web framework #2224#2299asukaminato0721 wants to merge 5 commits intofacebook:mainfrom
asukaminato0721 wants to merge 5 commits intofacebook:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds LSP support for FastAPI-style endpoints by offering URL path completions at HTTP client call sites and enabling go-to-definition from request path literals to the corresponding route handler.
Changes:
- Introduces
endpoint_supportmodule to collect route definitions from decorators and match them against client request literals. - Wires endpoint completions into the completion pipeline and endpoint literal resolution into go-to-definition.
- Adds regression tests covering endpoint completion and endpoint go-to-definition.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pyrefly/lib/state/lsp/endpoint_support.rs |
New endpoint discovery/matching logic for completions + definition lookup. |
pyrefly/lib/lsp/wasm/completion.rs |
Calls add_endpoint_completions during completion generation. |
pyrefly/lib/state/lsp.rs |
Registers the new module and hooks endpoint literal definition lookup into go-to-definition. |
pyrefly/lib/test/lsp/completion.rs |
Adds a completion test asserting endpoint paths are suggested for client.get/post(""). |
pyrefly/lib/test/lsp/definition.rs |
Adds a definition test asserting go-to-definition from client.get("/users") lands on the route function. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4f30fb8 to
5d31a61
Compare
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
part of #2224
Test Plan