Skip to content

Commit

Permalink
Update logging details for isort (#287)
Browse files Browse the repository at this point in the history
* Bug fixes and package updates from extension template

* Linting fixes

* Update logging details for `isort`
  • Loading branch information
karthiknadig authored Jun 6, 2023
1 parent 836b94c commit 41b6381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit 41b6381

Please sign in to comment.