mirror of
https://github.com/astral-sh/ty.git
synced 2025-12-23 08:48:09 +00:00
Stabilize auto-import (#1810)
Ref https://github.com/astral-sh/ty/issues/1765 Ref https://github.com/astral-sh/ruff/pull/21851 Ref https://github.com/astral-sh/ty-vscode/pull/234
This commit is contained in:
parent
84a1881169
commit
5c02e0b479
1 changed files with 66 additions and 60 deletions
|
|
@ -270,6 +270,72 @@ Whether to show argument names in call expressions as inline hints.
|
|||
|
||||
______________________________________________________________________
|
||||
|
||||
## `completions`
|
||||
|
||||
These settings control how code completions offered by ty work.
|
||||
|
||||
### `autoImport`
|
||||
|
||||
Whether to include auto-import suggestions in code completions. That is, code completions will
|
||||
include symbols not currently in scope but available in your environment.
|
||||
|
||||
**Default value**: `true`
|
||||
|
||||
**Type**: `boolean`
|
||||
|
||||
**Example usage**:
|
||||
|
||||
=== "VS Code"
|
||||
|
||||
```json
|
||||
{
|
||||
"ty.completions.autoImport": true
|
||||
}
|
||||
```
|
||||
|
||||
=== "Neovim"
|
||||
|
||||
```lua
|
||||
require('lspconfig').ty.setup({
|
||||
settings = {
|
||||
ty = {
|
||||
completions = {
|
||||
autoImport = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- For Neovim 0.11.0 and later:
|
||||
vim.lsp.config('ty', {
|
||||
settings = {
|
||||
ty = {
|
||||
completions = {
|
||||
autoImport = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
=== "Zed"
|
||||
|
||||
```json
|
||||
{
|
||||
"lsp": {
|
||||
"ty": {
|
||||
"settings": {
|
||||
"completions": {
|
||||
"autoImport": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
______________________________________________________________________
|
||||
|
||||
## `experimental`
|
||||
|
||||
These settings control the experimental language features that ty provides in an editor.
|
||||
|
|
@ -333,66 +399,6 @@ Whether to enable the experimental support for renaming symbols in the editor.
|
|||
}
|
||||
```
|
||||
|
||||
### `autoImport`
|
||||
|
||||
Whether to enable the experimental support for auto-import code completions. Note that this feature
|
||||
is currently under active development and may not work correctly or be gratuitously slow.
|
||||
|
||||
**Default value**: `false`
|
||||
|
||||
**Type**: `boolean`
|
||||
|
||||
**Example usage**:
|
||||
|
||||
=== "VS Code"
|
||||
|
||||
```json
|
||||
{
|
||||
"ty.experimental.autoImport": true
|
||||
}
|
||||
```
|
||||
|
||||
=== "Neovim"
|
||||
|
||||
```lua
|
||||
require('lspconfig').ty.setup({
|
||||
settings = {
|
||||
ty = {
|
||||
experimental = {
|
||||
autoImport = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- For Neovim 0.11.0 and later:
|
||||
vim.lsp.config('ty', {
|
||||
settings = {
|
||||
ty = {
|
||||
experimental = {
|
||||
autoImport = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
=== "Zed"
|
||||
|
||||
```json
|
||||
{
|
||||
"lsp": {
|
||||
"ty": {
|
||||
"settings": {
|
||||
"experimental": {
|
||||
"autoImport": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
______________________________________________________________________
|
||||
|
||||
## VS Code specific
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue