[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.
This commit is contained in:
Dhruv Manilawala 2025-06-17 13:50:45 +05:30 committed by GitHub
parent a1c69ca460
commit 390918e790
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 239 additions and 136 deletions

View file

@ -1,7 +1,7 @@
use crate::server::{ConnectionInitializer, Server};
use anyhow::Context;
pub use document::{NotebookDocument, PositionEncoding, TextDocument};
pub use session::{ClientSettings, DocumentQuery, DocumentSnapshot, Session};
pub use session::{DocumentQuery, DocumentSnapshot, Session};
use std::num::NonZeroUsize;
mod document;