-
Notifications
You must be signed in to change notification settings - Fork 5
Add python.ty.disableLanguageServices
config
#36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@dhruvmanila Can you say more about why this is blocked on microsoft/vscode-python#25041? What are the next steps for getting this merged? |
This PR as is will work only for the ty extension i.e., when |
But couldn't we ship "our half" of the changes separately from coordianting the setting with pylance (meaning, users would have to toggle the settings manually for now) |
We could, that's what I'm recommending in astral-sh/ruff#18650 (comment) now that I'm looking at it again. |
dfba961
to
e7af1b3
Compare
@@ -134,6 +134,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<void> | |||
await runServer(); | |||
}), | |||
onDidChangeConfiguration(async (e: vscode.ConfigurationChangeEvent) => { | |||
// TODO(dhruvmanila): Notify the server with `DidChangeConfigurationNotification` and let |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you plan to work on this as part of the client settings issue where you also want to explore a pull configuration model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
## Summary PR adding support for it in the VS Code extension: astral-sh/ty-vscode#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 astral-sh/ty#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 astral-sh/ty-vscode#36 for the test demo.
Summary
PR adding support for it in the language server: astral-sh/ruff#18230
This PR adds support for
python.ty.disableLanguageServices
in the extension to extract the value and pass it as server setting.Closes: #20
Test Plan
The video starts by the commented out
python.ty.disableLanguageServices
and you can see that there are inlay hints, hover support, diagnostics, etc.The hover content for
x
isLiteral[1]
.Once it's set to true, the server restarts and inlay hints are gone, hover content is gone but the diagnostics still remain as expected.
Screen.Recording.2025-05-20.at.15.14.41.mov