mirror of
https://github.com/astral-sh/ty.git
synced 2025-12-23 05:36:53 +00:00
Small documentation improvements (#1606)
This commit is contained in:
parent
72ed4e7ec7
commit
7a6b79d37e
3 changed files with 24 additions and 8 deletions
|
|
@ -6,13 +6,6 @@
|
|||
|
||||
An extremely fast Python type checker and language server, written in Rust.
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> ty is in preview and is not ready for production use.
|
||||
>
|
||||
> We're working hard to make ty stable and feature-complete, but until then, expect to encounter bugs,
|
||||
> missing features, and fatal errors.
|
||||
|
||||
## Getting started
|
||||
|
||||
Try out the [online playground](https://play.ty.dev), or run ty with
|
||||
|
|
|
|||
|
|
@ -8,7 +8,14 @@ The Astral team maintains an official VS Code extension.
|
|||
|
||||
Install the [ty extension](https://marketplace.visualstudio.com/items?itemName=astral-sh.ty) from the VS Code Marketplace.
|
||||
|
||||
See the extension's [README](https://github.com/astral-sh/ty-vscode) for more details on usage.
|
||||
Then disable the language server from the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) by adding the
|
||||
following [setting](https://code.visualstudio.com/docs/python/settings-reference#_intellisense-engine-settings) to your `settings.json` to avoid running two language servers:
|
||||
|
||||
```json
|
||||
{
|
||||
"python.languageServer": "None"
|
||||
}
|
||||
```
|
||||
|
||||
## Neovim
|
||||
|
||||
|
|
@ -110,5 +117,7 @@ ty server
|
|||
|
||||
Refer to your editor's documentation to learn how to connect to an LSP server.
|
||||
|
||||
## Customize your experience
|
||||
|
||||
See the [editor settings](./reference/editor-settings.md) for more details on configuring the language
|
||||
server.
|
||||
|
|
|
|||
|
|
@ -60,6 +60,20 @@ even when `type: ignore[code]` is used.
|
|||
add_three("one", 5) # type: ignore
|
||||
```
|
||||
|
||||
## Multiple suppressions comments
|
||||
|
||||
To suppress a typing error on a line that already has a suppression comment from another tool,
|
||||
add the `# ty: ignore` comment to the same line.
|
||||
|
||||
For example, to suppress a type error and disable formatting for a specific line:
|
||||
|
||||
```python
|
||||
result = calculate() # ty: ignore[invalid-argument-type] # fmt: skip
|
||||
|
||||
# or
|
||||
result = calculate() # fmt: off # ty: ignore[invalid-argument-type]
|
||||
```
|
||||
|
||||
## Unused suppression comments
|
||||
|
||||
If the [`unused-ignore-comment`](./reference/rules.md#unused-ignore-comment) rule is enabled, ty
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue