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

Update logging details for isort #287

Merged
merged 3 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Import sorting extension for Visual Studio Code using `isort`

A Visual Studio Code extension that provides import sorting using `isort`. The extension ships with `isort=5.11.5`.
A Visual Studio Code extension that provides import sorting using `isort`. The extension ships with `isort=5.11.5`. This extension uses Language Server Protocol ([LSP](https://microsoft.github.io/language-server-protocol/)) to run `isort` in a server like mode.

Note:

Expand Down Expand Up @@ -40,7 +40,6 @@ If you want to disable isort extension, you can [disable this extension](https:/
| isort.args | `[]` | Custom arguments passed to `isort`. E.g `"isort.args" = ["--settings-file", "<file>"]` |
| isort.check | `false` | Runs `isort --check` on open files and reports sorting issues as `Hint`. Update `isort.severity` to show sorting issues with higher severity. |
| isort.severity | `{ "W": "Warning", "E": "Hint" }` | Controls mapping of severity from `isort` to VS Code severity when displaying in the problems window. |
| isort.logLevel | `error` | Sets the tracing level for the extension. |
| isort.path | `[]` | Setting to provide custom `isort` executable. This will slow down formatting, since we will have to run `isort` executable every time or file save or open. Example 1: `["~/global_env/isort"]` Example 2: `["conda", "run", "-n", "lint_env", "python", "-m", "isort"]` |
| isort.interpreter | `[]` | Path to a python interpreter to use to run the linter server. |
| isort.importStrategy | `useBundled` | Setting to choose where to load `isort` from. `useBundled` picks isort bundled with the extension. `fromEnvironment` uses `isort` available in the environment. |
Expand All @@ -52,3 +51,7 @@ If you want to disable isort extension, you can [disable this extension](https:/
| Command | Description |
| -------------- | -------------------------------- |
| isort: Restart | Force re-start the isort server. |

## Logging

Use `Developer : Set Log Level...` command from the **Command Palette**, and select `isort` from the extensions list to set the Log Level for the extension. For detailed LSP traces, add `"isort.trace.server" : "verbose"` to your **User** `settings.json` file.
1 change: 0 additions & 1 deletion bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ def _log_verbose_config(settings: Dict[str, str]) -> None:
def _get_global_defaults():
return {
"check": GLOBAL_SETTINGS.get("check", False),
"logLevel": GLOBAL_SETTINGS.get("logLevel", "error"),
"path": GLOBAL_SETTINGS.get("path", []),
"severity": GLOBAL_SETTINGS.get("severity", {"E": "Hint", "W": "Warning"}),
"interpreter": GLOBAL_SETTINGS.get("interpreter", [sys.executable]),
Expand Down