Skip to main content

IDE Supported Features

Pyrefly’s language server powers a complete editing experience while fully disabling Pylance, ensuring no interference between checkers.

Each feature below links to the official LSP specification and shows what’s currently supported by Pyrefly.


Go to definition

Jump to where a symbol was originally defined with a click or F12. If there is both a .pyi and .py file, we will jump to the .py.


Go to type definition

Navigate to the underlying type of any expression. If the expression is a type, we will navigate to the .pyi file if both a .py and .pyi exist.


Go to declaration

Navigate to where the type was defined, but stop at imports.


Go to implementation

On a method, navigate to all reimplementations.


Move/rename file

When moving or renaming a file, Pyrefly will do it's best to rename all references to it.


Find references

List all usages of a symbol across your codebase.


Document symbols

See an outline of all top-level items in the current file.


Workspace symbols

Search globally for functions, classes, and variables.


Hover

See type info and docstrings when hovering over code.


Document highlights

Highlights all other instances of the symbol under your cursor.


Signature help

Live function signatures as you type, with parameter hints.


Completion

Autocomplete suggestions for project-specific symbols and imports.


Rename

Safely rename symbols project-wide.


Code actions

Code actions are automated fixes and refactorings that Pyrefly offers through your editor. They appear as lightbulb suggestions or can be triggered on save.

Quick Fix

When Pyrefly detects a type error, it may offer a quick fix — a one-click resolution available via the lightbulb menu (Cmd+. / Ctrl+.). Currently supported:

Quick fixDescription
Add missing importAutomatically add an import statement for an unresolved name
Remove redundant castRemove a typing.cast() call where the argument already has the target type

Fix All

Pyrefly registers the source.fixAll.pyrefly code action kind, which applies all available auto-fixes across a file at once. This is typically triggered on save.

The generic source.fixAll also triggers Pyrefly's fixes, so if you already use "source.fixAll": "always" (a common default), Pyrefly will participate alongside other tools like Ruff or ESLint. The tool-specific source.fixAll.pyrefly variant lets you control Pyrefly independently.

"editor.codeActionsOnSave": {
"source.fixAll.pyrefly": "always"
}

Refactor

Pyrefly supports a range of refactoring code actions, triggered via the lightbulb menu or keyboard shortcuts.

Pull Member Up and Push Member Down

Pull a method from a subclass to a superclass, or push a method from a superclass to a subclass.

Pull Member Up

Push Member Down

Convert to Package and Convert to Module

Convert to Package takes .py file and moves it to a package directory with all logic moved into an init.py file.

Convert to Module takes an existing package with all logic defined in its init.py and creates a named .py file from it.

Move function to top level

Takes a function nested within another function or statement and moves it to the top level of the module.

Introduce Parameter

Adds a new parameter to a function definition and update all call sites to pass the new parameter.

Inline Variable

Removes redundant variables by replacing them with their value.

Extract to Field

Declare a new field on a class with the value of the selected expression.

Extract to Variable

Declare a new variable with the value of the selected expression.

Invert Boolean

Flips the value of a boolean and updates all usages to work with new value.


Diagnostics

Type errors and warnings from Pyrefly’s checker appear in the diagnostics pane ("Problems" pane in VSCode).


Semantic tokens

Rich syntax highlighting based on token type and origin.


Inlay hints

Inline hints for types, parameter names, and return values.

You can turn inlay hints on or off using the VS Code setting editor.inlayHints.enabled.

We reuse Pyright's python.analysis.inlayHints.* settings for backwards compatibility. If you have or had Pyright installed, check these settings if inlay hints do not appear as expected.

SettingTypeDefaultDescription
python.analysis.inlayHints.callArgumentNames"all" | "off" | "partial""off"Show parameter names at call sites. "partial" only shows names for arguments where the name is not obvious from the value.
python.analysis.inlayHints.functionReturnTypesbooleantrueShow return type hints on functions without a return type annotation.
python.analysis.inlayHints.variableTypesbooleantrueShow type hints on variable assignments without a type annotation.
python.analysis.inlayHints.pytestParametersbooleanfalseShow type hints for pytest fixture parameters.

Inlay hints can be double clicked to insert them as an annotation.

Go-to-definition can be used on a type in an inlay hint to jump its definition. This works even if the type isn't explicitly imported by the current file.


Notebook support

Pyrefly provides language services for Jupyter notebooks directly in VS Code and also in Jupyter Lab. In Jupyter Lab, once you install the jupyterlab-lsp extension, and Pyrefly will appear on the list of automatically-detected language servers.

Pyrefly also provides language services to Marimo notebooks. See Language Server Protocol for how to enable it.

Notebook support is experimental. Please report any bugs on our Github.


Call Hierarchy

See all incoming functions calls to a particular function, as well as all outgoing function calls from a function. Call Hierarchy provides a full picture of how a particular function is used within a call stack.


Type Hierarchy

See all subclasses and superclasses of a selected class.


Planned features

See planned features and request your own on GitHub.