Ibraheem Ahmed
541b2096b6
wip
2025-06-19 21:58:29 -04:00
Ibraheem Ahmed
d1f16703ab
clear source texts
2025-06-18 23:10:17 -04:00
Dhruv Manilawala
390918e790
[ty] Add python.ty.disableLanguageServices
config ( #18230 )
...
## Summary
PR adding support for it in the VS Code extension:
https://github.com/astral-sh/ty-vscode/pull/36
This PR adds support for `python.ty.disableLanguageServices` to the ty
language server by accepting this as server setting.
This has the same issue as https://github.com/astral-sh/ty/issues/282 in
that it only works when configured globally. Fixing that requires
support for multiple workspaces in the server itself.
I also went ahead and did a similar refactor as the Ruff server to use
"Options" and "Settings" to keep the code consistent although the
combine functionality doesn't exists yet because workspace settings
isn't supported in the ty server.
## Test Plan
Refer to https://github.com/astral-sh/ty-vscode/pull/36 for the test
demo.
2025-06-17 13:50:45 +05:30
Andrew Gallant
869d7bf9a8
[ty] Stabilize completions ( #18650 )
...
Specifically, this PR reverts "Make completions an opt-in LSP feature
(#17921 )",
corresponding to commit 51e2effd2d
.
In practice, this means you don't need to opt into completions working
by enabling experimental features. i.e., I was able to remove this from
my LSP configuration:
```
"experimental": {
"completions": {
"enable": true
}
},
```
There's still a lot of work left to do to make completions awesome, but
I think it's in a state where it would be useful to get real user
feedback. It's also meaningfully using ty to provide completions that
use type information.
Ref astral-sh/ty#86
2025-06-16 07:44:08 -04:00
Micha Reiser
015222900f
Support cancellation requests ( #18627 )
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run
2025-06-12 22:08:42 +02:00
Micha Reiser
b44062b9ae
[ty] Fix stale documents on Windows ( #18544 )
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run
2025-06-09 16:39:11 +02:00
Micha Reiser
86e5a311f0
[ty] Introduce and use System::env_var
for better test isolation ( #18538 )
CI / cargo test (linux) (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / benchmarks (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
[ty Playground] Release / publish (push) Has been cancelled
2025-06-07 19:56:58 +02:00
Andrew Gallant
55100209c7
[ty] IDE: add support for object.<CURSOR>
completions ( #18468 )
...
This PR adds logic for detecting `Name Dot [Name]` token patterns,
finding the corresponding `ExprAttribute`, getting the type of the
object and returning the members available on that object.
Here's a video demonstrating this working:
https://github.com/user-attachments/assets/42ce78e8-5930-4211-a18a-fa2a0434d0eb
Ref astral-sh/ty#86
2025-06-05 11:15:19 -04:00
Micha Reiser
1e6d76c878
[ty] Fix server hang after shutdown request ( #18414 )
2025-06-02 06:57:51 +00:00
Micha Reiser
66ba1d8775
[ty] Support cancellation and retry in the server ( #18273 )
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run
2025-05-28 10:59:29 +02:00
Dhruv Manilawala
48c425c15b
[ty] Support publishing diagnostics in the server ( #18309 )
...
## Summary
This PR adds support for [publishing
diagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics )
from the ty language server.
It only adds support for it for text documents and not notebook
documents because the server doesn't have full notebook support yet.
Closes : astral-sh/ty#79
## Test Plan
Testing this out in Helix and Zed since those are the two editors that I
know of that doesn't support pull diagnostics:
### Helix
https://github.com/user-attachments/assets/e193f804-0b32-4f7e-8b83-6f9307e3d2d4
### Zed
https://github.com/user-attachments/assets/93ec7169-ce2b-4521-b009-a82d8afb9eaa
2025-05-28 13:15:11 +05:30
Micha Reiser
175402aa75
[ty] Remove unnecessary lifetimes for Task
( #18261 )
2025-05-26 12:44:43 +00:00
Micha Reiser
d8216fa328
[ty] Gracefully handle salsa cancellations and panics in background request handlers ( #18254 )
2025-05-26 13:37:49 +01:00
Micha Reiser
66b082ff71
[ty] Abort process if worker thread panics ( #18211 )
2025-05-26 13:09:06 +01:00
Dhruv Manilawala
d95b029862
[ty] Move diagnostics API for the server ( #18308 )
...
## Summary
This PR moves the diagnostics API for the language server out from the
request handler module to the diagnostics API module.
This is in preparation to add support for publishing diagnostics.
2025-05-26 04:16:38 +00:00
Dhruv Manilawala
32403dfb28
[ty] Avoid panicking when there are multiple workspaces ( #18151 )
...
## Summary
This PR updates the language server to avoid panicking when there are
multiple workspace folders passed during initialization. The server
currently picks up the first workspace folder and provides a warning and
a log message.
## Test Plan
<img width="1724" alt="Screenshot 2025-05-17 at 11 43 09"
src="https://github.com/user-attachments/assets/1a7ddbc3-198d-4191-a28f-9b69321e8f99 "
/>
2025-05-20 20:53:23 +05:30
Micha Reiser
ac5df56aa3
[ty] Small LSP cleanups ( #18201 )
2025-05-19 17:08:59 +00:00
Micha Reiser
6985de4c40
[ty] Show related information in diagnostic ( #17359 )
2025-05-19 18:52:12 +02:00
Chandra Kiran G
b86960f18c
[ty] Add rule link to server diagnostics ( #18128 )
...
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-17 17:27:59 +00:00
Micha Reiser
9ae698fe30
Switch to Rust 2024 edition ( #18129 )
2025-05-16 13:25:28 +02:00
Brent Westbrook
981bd70d39
Convert Message::SyntaxError
to use Diagnostic
internally ( #17784 )
...
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run
## Summary
This PR is a first step toward integration of the new `Diagnostic` type
into ruff. There are two main changes:
- A new `UnifiedFile` enum wrapping `File` for red-knot and a
`SourceFile` for ruff
- ruff's `Message::SyntaxError` variant is now a `Diagnostic` instead of
a `SyntaxErrorMessage`
The second of these changes was mostly just a proof of concept for the
first, and it went pretty smoothly. Converting `DiagnosticMessage`s will
be most of the work in replacing `Message` entirely.
## Test Plan
Existing tests, which show no changes.
---------
Co-authored-by: Carl Meyer <carl@astral.sh>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-08 12:45:51 -04:00
Micha Reiser
51386b3c7a
[ty] Add basic file watching to server ( #17912 )
2025-05-07 19:03:30 +02:00
Charlie Marsh
51e2effd2d
Make completions an opt-in LSP feature ( #17921 )
...
## Summary
We now expect the client to send initialization options to opt-in to
experimental (but LSP-standardized) features, like completion support.
Specifically, the client should set `"experimental.completions.enable":
true`.
Closes https://github.com/astral-sh/ty/issues/74 .
2025-05-07 16:39:35 +00:00
Charlie Marsh
ad658f4d68
Clean up some Ruff references in the ty server ( #17920 )
...
## Summary
Anything user-facing, etc.
2025-05-07 10:55:16 -04:00
Micha Reiser
fa628018b2
Use #[expect(lint)]
over #[allow(lint)]
where possible ( #17822 )
2025-05-03 21:20:31 +02:00
Eric Botti
8535af8516
[red-knot] Add support for the LSP diagnostic tag ( #17657 )
...
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-03 20:35:03 +02:00
Micha Reiser
b51c4f82ea
Rename Red Knot ( #17820 )
2025-05-03 19:49:15 +02:00