Skip to content

fix autocomplete endpoints in web framework #2224#2299

Open
asukaminato0721 wants to merge 5 commits intofacebook:mainfrom
asukaminato0721:2224
Open

fix autocomplete endpoints in web framework #2224#2299
asukaminato0721 wants to merge 5 commits intofacebook:mainfrom
asukaminato0721:2224

Conversation

@asukaminato0721
Copy link
Contributor

Summary

part of #2224

Test Plan

@meta-cla meta-cla bot added the cla signed label Feb 4, 2026
@github-actions

This comment has been minimized.

@asukaminato0721 asukaminato0721 marked this pull request as ready for review February 4, 2026 07:40
Copilot AI review requested due to automatic review settings February 4, 2026 07:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_support module 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.

@asukaminato0721 asukaminato0721 marked this pull request as ready for review March 22, 2026 00:42
@github-actions
Copy link

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants