Closed munkybutt closed 3 months ago
I just noticed that when I open my lsp-ruff.sublime-settings file this is printed to the console:
Unable to open /C/Users/Shea.Richardson/AppData/Roaming/Sublime Text/Packages/LSP-ruff/LSP-ruff.sublime-settings
@jfcherng
I just noticed that when I open my lsp-ruff.sublime-settings file this is printed to the console:
Unable to open /C/Users/Shea.Richardson/AppData/Roaming/Sublime Text/Packages/LSP-ruff/LSP-ruff.sublime-settings
did you try to restart ST?
yes - restart ruff from command panel, restart ST. I have yet to uninstall/re-install lsp-ruff. I shall try that
Still the same after a re-install :(
The settings must be found as this prints when I save them:
reloading settings Packages/User/LSP-ruff.sublime-settings
Can you show the output of LSP: Troubleshoot server
?
It shows effective settings that are used.
But if you are getting a message like Unable to open /C/Users/Shea.Richardson/AppData/Roaming/Sublime Text/Packages/LSP-ruff/LSP-ruff.sublime-settings
then it means that the initializationOptions
that you provided in your initial message are not saved in the correct file. In which files did you set those?
Here is the output of LSP: Troublshoot server
## Server Configuration
- command
```json
[
"$server_path",
"server"
]
"C:\Users\Shea.Richardson\AppData\Local\Sublime Text\Package Storage\LSP-ruff\Scripts\ruff.exe" server
source.python
source.python
{
"globalSettings": {
"codeAction": {
"disableRuleComment": {
"enable": true
},
"fixViolation": {
"enable": true
}
},
"configuration": "D:/p4/tools/dcc_tools/mg_tools/.projects/ruff.toml",
"configurationPreference": "editorFirst",
"exclude": null,
"fixAll": true,
"format": {
"preview": null
},
"lineLength": null,
"lint": {
"enable": true,
"extendSelect": null,
"ignore": null,
"preview": null,
"select": null
},
"logLevel": "error",
"organizeImports": true,
"showNotification": "on"
},
"settings": {}
}
{}
{
"PATH": "C:\\Users\\Shea.Richardson\\AppData\\Local\\Sublime Text\\Package Storage\\LSP-ruff\\Scripts;"
}
None
{
"auto_complete_selector": null,
"lsp_active": null,
"syntax": null
}
[
"D:\\p4\\tools\\dcc_tools\\mg_tools\\_standalone\\python",
"D:\\p4\\tools\\dcc_tools\\mg_tools\\unreal\\python"
]
{
"debugger_configurations": [
{
"connect": {
"host": "localhost",
"port": 7778
},
"justMyCode": false,
"name": "Remote",
"request": "attach",
"type": "python"
}
],
"folders": [
{
"file_exclude_patterns": [
".pyc"
],
"folder_exclude_patterns": [
"__pycache__",
".vscode",
".qt_for_python",
"c#",
"c++",
"*.egg-info"
],
"name": "standalone",
"path": "../../_standalone/python"
},
{
"file_exclude_patterns": [
".pyc"
],
"folder_exclude_patterns": [
"__pycache__",
".vscode",
".qt_for_python",
"c#",
"c++",
"*.egg-info"
],
"name": "unreal",
"path": "../../unreal/python"
}
],
"settings": {
"LSP": {
"LSP-basedpyright": {
"settings": {
"basedpyright.analysis.extraPaths": [
]
}
},
"LSP-pyright": {
"settings": {
"python.analysis.extraPaths": [
]
}
}
}
}
}
{
"diagnostics_additional_delay_auto_complete_ms": 0,
"diagnostics_delay_ms": 0,
"diagnostics_gutter_marker": "dot",
"diagnostics_highlight_style": {
"error": "squiggly",
"hint": "underline",
"info": "underline",
"warning": "squiggly"
},
"diagnostics_panel_include_severity_level": 4,
"document_highlight_style": "underline",
"inhibit_snippet_completions": false,
"inhibit_word_completions": true,
"log_debug": false,
"log_max_size": 8192,
"log_server": [],
"lsp_code_actions_on_save": {
"source.organizeImports": true
},
"lsp_format_on_save": false,
"on_save_task_timeout_ms": 2000,
"popup_max_characters_height": 1250,
"popup_max_characters_width": 100,
"semantic_highlighting": false,
"show_code_actions": "annotation",
"show_code_actions_in_hover": true,
"show_code_lens": "annotation",
"show_diagnostics_count_in_view_status": false,
"show_diagnostics_in_view_status": true,
"show_diagnostics_panel_on_save": 0,
"show_diagnostics_severity_level": 4,
"show_multiline_diagnostics_highlights": true,
"show_references_in_quick_panel": false,
"show_symbol_action_links": true,
"show_view_status": true
}
And I save the settings to the file that is opened using the ST menu:
Which is: C:\Users\Shea.Richardson\AppData\Roaming\Sublime Text\Packages\User\LSP-ruff.sublime-settings
When the settings window opens is when the error prints that the file that has just been opened cannot be found 😕
Do you likely have your own custom override in Package/
And I save the settings to the file that is opened using the ST menu: Which is:
C:\Users\Shea.Richardson\AppData\Roaming\Sublime Text\Packages\User\LSP-ruff.sublime-settings
When the settings window opens is when the error prints that the file that has just been opened cannot be found 😕
So when you clike the menu item in your screenshot, the left pane is empty?
Huh wait, I see Unable to open /C/Users/jfcherng/AppData/Roaming/Sublime Text/Packages/LSP-ruff/LSP-ruff.sublime-settings
in my console too.
Huh wait, I see
Unable to open /C/Users/jfcherng/AppData/Roaming/Sublime Text/Packages/LSP-ruff/LSP-ruff.sublime-settings
in my console too.
I think this is a ST bug. It happens for every plugin when open settings with side-by-side layout.
ah ok so red herring heh
Do you likely have your own custom override in Package/
And I save the settings to the file that is opened using the ST menu: Which is:
C:\Users\Shea.Richardson\AppData\Roaming\Sublime Text\Packages\User\LSP-ruff.sublime-settings
When the settings window opens is when the error prints that the file that has just been opened cannot be found 😕So when you clike the menu item in your screenshot, the left pane is empty?
No override in packages
But that shouldn't matter. I am now trying to check how ruff server
uses initializationOptions
but I can't find any document about that.
initializationOptions
worked prior to v2.0.0
what if you move everything in globalSettings
into settings
?
Based on neovim configuration examples in https://docs.astral.sh/ruff/editors/settings/#__tabbed_1_2 it should be:
{
"initializationOptions": {
"settings": {
"configuration": "D:/p4/tools/dcc_tools/mg_tools/.projects/ruff.toml",
"showNotification": "on",
"organizeImports": true,
"fixAll": true,
},
}
}
And options like showNotifications
might not do anything for us. This is marked as VSCode specific.
I can't find any source about "globalSettings". If "settings" works, we can just move to it.
what if you move everything in
globalSettings
intosettings
?
this seems to have done the trick - tyty!
Hey - with the latest update I have migrated across to the new settings but it seems like my "ruff.toml" file is ignored. I noticed my imports were no longer being sorted according to my isort rules and the behaviour remains the same if the "configuration" key is commented out or not. These are my settings:
To confirm, the ruff.toml path does exist and it was working with the previous lsp-ruff version yesterday.
This is the contents of my ruff.toml
Any help would be appreciated