Repository navigation
Conversation
Summary: Stack context: show `Doc(...)` parameter docs (annotated-doc, as FastAPI uses) in completion items, as hover already does. Plan step: test of current behavior. - What: add a completion test for a class and a method whose parameters use `Annotated[..., Doc(...)]`. - Why: completion shows only the docstring today. Hover shows the parameter docs too. The next diff fixes completion, and this test shows the change. ___ landed-with-radar-review Differential Revision: D135986768
Summary: Stack context: show `Doc(...)` parameter docs (annotated-doc, as FastAPI uses) in completion items, as hover already does. Plan step: the fix. - What: completion item documentation now shows the docstring followed by the `Doc(...)` documentation of each parameter, in the same format as hover. This applies to name completions (such as `app = FastAPI<ctrl+space>`) and attribute completions. - Why: a FastAPI user asked for it. Hover already shows these docs, but completion showed only the docstring, though the export already holds the parameter `Doc` ranges. - Hover and completion now share `format_parameter_docs`, so the two stay the same. ___ landed-with-radar-review Differential Revision: D135986769
Contributor
|
@kinto0 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D135986769. |
kinto0
added a commit
to kinto0/pyrefly
that referenced
this pull request
Dec 3, 2026
kinto0
added a commit
to kinto0/pyrefly
that referenced
this pull request
Dec 3, 2026
kinto0
added a commit
to kinto0/pyrefly
that referenced
this pull request
Dec 3, 2026
kinto0
added a commit
to kinto0/pyrefly
that referenced
this pull request
Dec 3, 2026
kinto0
added a commit
to kinto0/pyrefly
that referenced
this pull request
Dec 3, 2026
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Contributor
|
This pull request has been merged in 06348a1. |
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:
Stack context: show
Doc(...)parameter docs (annotated-doc, as FastAPI uses) in completion items, as hover already does.Plan step: the fix.
Doc(...)documentation of each parameter, in the same format as hover. This applies to name completions (such asapp = FastAPI<ctrl+space>) and attribute completions.Docranges.format_parameter_docs, so the two stay the same.VS Code with FastAPI 0.165.0, ctrl+space after
app = FastAPI:After,
api.getmethod completion (details pane scrolled to the parameter docs):Plain function
Depends, ctrl+space afterdep = Depends(details pane scrolled to the end):landed-with-radar-review
Differential Revision: D135986769