docs/features/language-server.md
You can generally expect ty to be a fully-featured language server for Python. This page describes some of the key features provided by ty's IDE integration and includes a reference table of supported LSP features at the end. See the editor integration guide for instructions on how to set up ty with your editor.
ty reports type errors and other diagnostics directly in your editor. Diagnostics
are updated as you type. You can use the
diagnosticMode setting to control if you want to
see diagnostics for open files only, or for your entire workspace.
!!! info
ty supports both the "pull" and "push" diagnostic models. Most modern editors will use the "pull" model
for better performance, where diagnostics are fetched on demand rather than pushed after every
change.
ty powers several language server features that allow you to navigate a Python codebase:
Person
when invoked on a variable user: Person.ty provides intelligent code completions as you type, offering suggestions for variables, functions, classes, and modules that are in scope.
For symbols that are not yet imported, ty suggests auto-import actions to add the necessary import statements.
ty offers quick fixes and other code actions to help you resolve issues:
ty surfaces useful contextual information as you code:
( and updates as you navigate between arguments.ty provides Python specific code folding ranges to LSP clients upon request. This includes tagging docstrings as comments, which supports editor actions like "fold all comment blocks."
ty supports Jupyter notebooks (.ipynb files) with language server features. Each cell is
analyzed in context, with diagnostics, completions, and other features working across cells.
ty's architecture is designed for low-latency updates of diagnostics and other language server features. When you make a change in your editor, ty incrementally updates only the affected parts of the codebase, rather than re-analyzing everything from scratch. This happens at a fine-grained level, down to individual definitions. This incrementality means that you get instant feedback as you type, i.e., within a few milliseconds, even on large projects.
!!! info
Fine-grained dependencies also allow ty to skip large parts of 3rd-party dependencies when they are not relevant
to your codebase.