Skip to content
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

Register VS Code command as per server capabilities #513

Closed
dhruvmanila opened this issue Jul 3, 2024 · 1 comment
Closed

Register VS Code command as per server capabilities #513

dhruvmanila opened this issue Jul 3, 2024 · 1 comment
Labels
internal An internal refactor or improvement

Comments

@dhruvmanila
Copy link
Member

The VS Code commands should only be registered if it's available in the server capabilities (astral-sh/ruff#11850). This way we don't need to check for Ruff version in which a command was added.

This is not a high priority and can be done after the stable release.

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Jul 23, 2024
@dhruvmanila
Copy link
Member Author

I don't think this is possible because the VS Code command registration happens in the extension manifest via https://code.visualstudio.com/api/references/contribution-points#contributes.commands.

ruff-vscode/package.json

Lines 418 to 454 in d5cfec6

"commands": [
{
"title": "Fix all auto-fixable problems",
"category": "Ruff",
"command": "ruff.executeAutofix"
},
{
"title": "Format document",
"category": "Ruff",
"command": "ruff.executeFormat"
},
{
"title": "Format imports",
"category": "Ruff",
"command": "ruff.executeOrganizeImports"
},
{
"title": "Print debug information (native server only)",
"category": "Ruff",
"command": "ruff.debugInformation"
},
{
"title": "Restart Server",
"category": "Ruff",
"command": "ruff.restart"
},
{
"title": "Show client logs",
"category": "Ruff",
"command": "ruff.showLogs"
},
{
"title": "Show server logs",
"category": "Ruff",
"command": "ruff.showServerLogs"
}
]

@dhruvmanila dhruvmanila closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

No branches or pull requests

1 participant