ty icon indicating copy to clipboard operation
ty copied to clipboard

turn off diagnostics/typecheck diagnostics

Open carlesoctav opened this issue 2 months ago • 7 comments

Question

TLDR: I want the reverse of disableLanguageServices

My setup mainly uses Pyright + Ruff, with Pyright diagnostics disabled. I don’t really rely on full type-checking and only want simple diagnostics from the Ruff linter. I mostly use Pyright as a “go-to-definition” engine. I want do the same with ty.

I’m trying to find a setting in ty that disables this while still keeping navigation features, but I couldn’t find anything equivalent.

Version

No response

carlesoctav avatar Dec 04 '25 15:12 carlesoctav

I think adding this as a configuration option (or having a drop down with LSP, Diagnostics only, and Full) makes sense.

An alternative is to allow users to easily deselect all rules.

MichaReiser avatar Dec 04 '25 15:12 MichaReiser

on nvim, it can be disabled by client.server_capabilities.diagnosticProvider = true but would be the best i can be controlled within ty setting

echaya avatar Dec 05 '25 12:12 echaya

+1 for this. I'm having @carlesoctav's setup too: pyright (no diag) + ruff. This feature feels mandatory and obvious, especially since many of us already use ruff.

futurisold avatar Dec 19 '25 09:12 futurisold

+1 for this. I'm having @carlesoctav's setup too: pyright (no diag) + ruff. This feature feels mandatory and obvious, especially since many of us already use ruff.

Note that ty and ruff show different diagnostics. There are some diagnostics like syntax errors that are surfaced by both tools, but you can disable them in ruff https://docs.astral.sh/ruff/editors/settings/#showsyntaxerrors

MichaReiser avatar Dec 19 '25 09:12 MichaReiser

I know, that is also true of pyright. In my case, I already have a configured ruff.toml with the rules I care about, and using ty comes down to the fact that it does not interfere at all with that setup. There is no point in having two tools. If ty provides unique diagnostics, they can become part of ruff, in my opinion, similar to how flake and others are integrated. What makes ty an exception to this rule?

futurisold avatar Dec 19 '25 09:12 futurisold

What makes ty an exception to this rule?

It works fundamentally differently from Ruff because it supports multifile analysis. Integrating ty (or ruff into ty) is a big lift. We may do this in the future but decided against it to ship a type checker sooner.

MichaReiser avatar Dec 19 '25 09:12 MichaReiser

That makes sense. Then I suppose the most convenient path forward is to give us an option to disable diagnostics.

futurisold avatar Dec 19 '25 09:12 futurisold