You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extension uses workspace settings for all files. In this case, it formats on save and trims lines to 120 characters.
Actual Behavior
Extension uses workspace settings only when the file modified is within the workspace folder, otherwise it uses global settings. This is not ideal, because other settings don't work like this. The above settings result in other files outside the workspace being formatted on save with lines trimmed to 80 characters.
Possible Workarounds
Changing the global settings to "args": ["--help"] would work, but it would then require every file to be in a workspace in order to format it.
Disabling the workspace formatOnSave is not ideal when working on a project with strict formatting.
Ideal Solution
Add a way for disabling save formatting on files outside the workspace when workspace args are used.
Logs:
2024-08-14 17:13:16.801 [info] No interpreter found from setting black-formatter.interpreter
2024-08-14 17:13:16.801 [info] Getting interpreter from ms-python.python extension for workspace /home/user/Documents/IsaacLabExtensionTemplate
2024-08-14 17:13:16.803 [info] Interpreter from ms-python.python extension for /home/user/Documents/IsaacLabExtensionTemplate: /home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python.sh
2024-08-14 17:13:16.803 [info] Workspace settings for /home/user/Documents/IsaacLabExtensionTemplate (client side): {
"cwd": "/home/user/Documents/IsaacLabExtensionTemplate",
"workspace": "file:///home/user/Documents/IsaacLabExtensionTemplate",
"args": [
"--line-length",
"120"
],
"path": [],
"interpreter": [
"/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python.sh"
],
"importStrategy": "useBundled",
"showNotifications": "always"
}
2024-08-14 17:13:16.804 [info] Server: Stop requested
2024-08-14 17:13:16.804 [info] [Trace - 17:13:16] Sending request 'shutdown - (2)'.
2024-08-14 17:13:16.805 [info] [Trace - 17:13:16] Received response 'shutdown - (2)' in 1ms.
2024-08-14 17:13:16.805 [info] [Trace - 17:13:16] Sending notification 'exit'.
2024-08-14 17:13:16.806 [info] No interpreter found from setting black-formatter.interpreter
2024-08-14 17:13:16.806 [info] Getting interpreter from ms-python.python extension for workspace /home/user/Documents/IsaacLabExtensionTemplate
2024-08-14 17:13:16.808 [info] Interpreter from ms-python.python extension for /home/user/Documents/IsaacLabExtensionTemplate: /home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python.sh
2024-08-14 17:13:16.808 [info] Workspace settings for /home/user/Documents/IsaacLabExtensionTemplate (client side): {
"cwd": "/home/user/Documents/IsaacLabExtensionTemplate",
"workspace": "file:///home/user/Documents/IsaacLabExtensionTemplate",
"args": [
"--line-length",
"120"
],
"path": [],
"interpreter": [
"/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python.sh"
],
"importStrategy": "useBundled",
"showNotifications": "always"
}
2024-08-14 17:13:16.808 [info] Global settings (client side): {
"cwd": "/home/user",
"workspace": "/home/user",
"args": [
"--line-length",
"80"
],
"path": [],
"interpreter": [],
"importStrategy": "useBundled",
"showNotifications": "always"
}
2024-08-14 17:13:16.809 [info] Server run command: /home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python.sh /home/user/.vscode/extensions/ms-python.black-formatter-2024.2.0/bundled/tool/lsp_server.py
2024-08-14 17:13:16.809 [info] Server: Start requested.
2024-08-14 17:13:16.884 [info] [Error - 17:13:16] Server process exited with code 0.
2024-08-14 17:13:17.268 [info] CWD Server: /home/user/Documents/IsaacLabExtensionTemplate
2024-08-14 17:13:17.269 [info] Settings received on server:
[
{
"cwd": "/home/user/Documents/IsaacLabExtensionTemplate",
"workspace": "file:///home/user/Documents/IsaacLabExtensionTemplate",
"args": [
"--line-length",
"120"
],
"path": [],
"interpreter": [
"/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python.sh"
],
"importStrategy": "useBundled",
"showNotifications": "always"
}
]
2024-08-14 17:13:17.269 [info] Global settings received on server:
{
"cwd": "/home/user",
"workspace": "/home/user",
"args": [
"--line-length",
"80"
],
"path": [],
"interpreter": [],
"importStrategy": "useBundled",
"showNotifications": "always"
}
2024-08-14 17:13:17.269 [info] sys.path used to run Server:
/home/user/.vscode/extensions/ms-python.black-formatter-2024.2.0/bundled/libs
/home/user/.vscode/extensions/ms-python.black-formatter-2024.2.0/bundled/tool
/home/user/catkin_ws/devel/lib/python3/dist-packages
/opt/ros/noetic/lib/python3/dist-packages
/home/user
/home/user/slim
/home/user/.local/share/home/user/catkin_ws/devel/lib/python3/dist-packages
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/python/lib/python3.10/site-packages
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python_packages
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.kit
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.gym
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/kernel/py
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/plugins/bindings-python
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.lula/pip_prebundle
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.exporter.urdf/pip_prebundle
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/exts/omni.kit.pip_archive/pip_prebundle
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core_archive/pip_prebundle
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.ml_archive/pip_prebundle
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.pip.compute/pip_prebundle
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.pip.cloud/pip_prebundle
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/python/lib/python310.zip
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/python/lib/python3.10
/home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/python/lib/python3.10/lib-dynload
/home/user/Documents/IsaacLab/source/extensions/omni.isaac.lab_assets
/home/user/Documents/IsaacLab/source/extensions/omni.isaac.lab
/home/user/Documents/IsaacLab/source/extensions/omni.isaac.lab_tasks
2024-08-14 17:13:17.271 [info] /home/user/.local/share/ov/pkg/isaac-sim-4.1.0/python.sh -m black --version
2024-08-14 17:13:17.271 [info] CWD formatter: /home/user/Documents/IsaacLabExtensionTemplate
2024-08-14 17:13:17.421 [info] Version info for formatter running for /home/user/Documents/IsaacLabExtensionTemplate:
black, 24.3.0 (compiled: no)
Python (CPython) 3.10.14
2024-08-14 17:13:17.421 [info] SUPPORTED black>=22.3.0
FOUND black==24.3.0
2024-08-14 17:13:20.191 [info] [Trace - 17:13:20] Sending request 'textDocument/formatting - (1)'.
2024-08-14 17:13:20.194 [info] [Trace - 17:13:20] Received notification 'window/logMessage'.
2024-08-14 17:13:20.195 [info] /home/user/.local/share/ov/pkg/isaac-sim-4.1.0/kit/python/bin/python3 -m black --line-length 80 --stdin-filename /home/user/Documents/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/sim/__init__.py -
2024-08-14 17:13:20.195 [info] [Trace - 17:13:20] Received notification 'window/logMessage'.
2024-08-14 17:13:20.195 [info] CWD formatter: /home/user/Documents/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/sim
2024-08-14 17:13:20.278 [info] [Trace - 17:13:20] Received notification 'window/logMessage'.
2024-08-14 17:13:20.278 [info] reformatted /home/user/Documents/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/sim/__init__.py
All done! ✨ 🍰 ✨
1 file reformatted.
2024-08-14 17:13:20.280 [info] [Trace - 17:13:20] Received response 'textDocument/formatting - (1)' in 89ms.
2024-08-14 17:13:20.288 [info] [Trace - 17:13:20] Sending notification 'textDocument/didChange'.
The text was updated successfully, but these errors were encountered:
spok7
added
the
bug
Issue identified by VS Code Team member as probable bug
label
Aug 14, 2024
karthiknadig
changed the title
Inconsistent formatting on files outside of currently open folder.
Add option to ignore files outside of a workspace
Aug 15, 2024
Thank you for submitting your feature request and everyone who considered it! Unfortunately, this issue did not receive enough votes over the allotted time, and so we are closing the issue.
Diagnostic Data
Behaviour
Consider the following user and workspace settings files:
.config/Code/User/settings.json
workspace/.vscode/settings.json
Expected Behavior
Extension uses workspace settings for all files. In this case, it formats on save and trims lines to 120 characters.
Actual Behavior
Extension uses workspace settings only when the file modified is within the workspace folder, otherwise it uses global settings. This is not ideal, because other settings don't work like this. The above settings result in other files outside the workspace being formatted on save with lines trimmed to 80 characters.
Possible Workarounds
"args": ["--help"]
would work, but it would then require every file to be in a workspace in order to format it.Ideal Solution
Add a way for disabling save formatting on files outside the workspace when workspace args are used.
Logs:
The text was updated successfully, but these errors were encountered: