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

Unwanted auto formatting on Enter #23127

Closed
shaoqx opened this issue Mar 26, 2024 · 2 comments
Closed

Unwanted auto formatting on Enter #23127

shaoqx opened this issue Mar 26, 2024 · 2 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@shaoqx
Copy link

shaoqx commented Mar 26, 2024

Type: Bug

Behaviour

Expected vs. Actual

when hit "Enter"

  • Expected: just create a new line
  • Actual: create a new line and auto format the entire document

Steps to reproduce:

This problem shows up from time to time. It disappears after I reload the vscode from command plate. It finally ruined my changes this time and I decided to report.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.18
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Pylance
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

I copied the relevant output from Python languageServer

2024-03-25 20:21:11.940 [info] (Client) Pylance async client (2024.3.1) started with python extension (2024.2.1)
2024-03-25 20:21:14.048 [info] [Info  - 8:21:13 PM] (122123) Pylance language server 2024.3.1 (pyright version 1.1.351, commit 87171fbf) starting
2024-03-25 20:21:14.242 [info] [Info  - 8:21:14 PM] (122123) Server root directory: file:///panfs/accrepfs.vampire/home/shaoq1/.vscode-server/extensions/ms-python.vscode-pylance-2024.3.1/dist
2024-03-25 20:21:14.244 [info] [Info  - 8:21:14 PM] (122123) Starting service instance "EnzyHTP-refactor"
2024-03-25 20:21:14.567 [info] [Info  - 8:21:14 PM] (122123) Background analysis(1) root directory: file:///panfs/accrepfs.vampire/home/shaoq1/.vscode-server/extensions/ms-python.vscode-pylance-2024.3.1/dist
2024-03-25 20:21:14.704 [info] [Info  - 8:21:14 PM] (122123) Background analysis(1) started
2024-03-25 20:21:14.897 [info] [Info  - 8:21:14 PM] (122123) Setting pythonPath for service "EnzyHTP-refactor": "/home/shaoq1/bin/miniconda3/envs/new_EnzyHTP/bin/python"
2024-03-25 20:21:14.898 [info] [Info  - 8:21:14 PM] (122123) Setting environmentName for service "EnzyHTP-refactor": "3.9.18 (new_EnzyHTP conda)"
2024-03-25 20:21:14.950 [info] [Info  - 8:21:14 PM] (122123) Assuming Python version 3.9
2024-03-25 20:21:15.666 [info] [Info  - 8:21:15 PM] (122123) Found 376 source files
2024-03-25 20:21:16.501 [info] [Info  - 8:21:16 PM] (122123) Indexer background runner(2) root directory: file:///panfs/accrepfs.vampire/home/shaoq1/.vscode-server/extensions/ms-python.vscode-pylance-2024.3.1/dist (index)
2024-03-25 20:21:16.502 [info] [Info  - 8:21:16 PM] (122123) Indexing(2) started
2024-03-25 20:21:19.005 [info] [Info  - 8:21:19 PM] (122123) [BG(1)] Long operation: checking: file:///panfs/accrepfs.vampire/home/shaoq1/bin/dev_test/EnzyHTP-refactor/enzy_htp/workflow_app/multiefdes_main.py (2200ms)
2024-03-25 20:21:19.005 [info] [Info  - 8:21:19 PM] (122123) [BG(1)] Long operation: analyzing: file:///panfs/accrepfs.vampire/home/shaoq1/bin/dev_test/EnzyHTP-refactor/enzy_htp/workflow_app/multiefdes_main.py (2526ms)
2024-03-25 20:21:19.270 [info] [Info  - 8:21:19 PM] (122123) [IDX(2)] Long operation: scan packages file:///panfs/accrepfs.vampire/home/shaoq1/bin/dev_test/EnzyHTP-refactor (3164ms)
2024-03-25 20:21:19.270 [info] [Info  - 8:21:19 PM] (122123) scanned(2) 209 files over 1 exec env
2024-03-25 20:21:21.044 [info] [Info  - 8:21:21 PM] (122123) indexed(2) 138 files over 1 exec env
2024-03-25 20:21:21.349 [info] [Info  - 8:21:21 PM] (122123) Indexing finished(2).
2024-03-25 20:21:34.437 [info] [Info  - 8:21:34 PM] (122123) Found 377 source files
2024-03-25 20:21:37.808 [info] [Info  - 8:21:37 PM] (122123) Found 376 source files

languageServer: "Pylance"

testing
• pytestArgs: ""
• pytestEnabled: true


</p>
</details>


Extension version: 2024.2.1
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Remote OS version: Linux x64 3.10.0-1160.71.1.el7.x86_64
Connection to 'ssh-remote+mutant.accre.vanderbilt.edu' could not be established

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 9 7940HS w/ Radeon 780M Graphics      (16 x 3993)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|15.21GB (5.77GB free)|
|Process Argv|--file-uri vscode-remote://ssh-remote%2Bmutant.accre.vanderbilt.edu/home/shaoq1/bin/dev_test/EnzyHTP-refactor.code-workspace --crash-reporter-id 66e205f3-c67b-4e48-b927-403ed275aa45|
|Screen Reader|no|
|VM|0%|

|Item|Value|
|---|---|
|Remote|SSH: mutant.accre.vanderbilt.edu|
|OS|Linux x64 3.10.0-1160.71.1.el7.x86_64|
|CPUs|AMD EPYC 7542 32-Core Processor (128 x 2894)|
|Memory (System)|1007.35GB (462.74GB free)|
|VM|0%|

Connection to 'ssh-remote+mutant.accre.vanderbilt.edu' could not be established
</details><details>
<summary>A/B Experiments</summary>

vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30998030
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfcontrol:30979541
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp2r3:30993541
dsvsc020:30976470
pythonaic:30996667
dsvsc021:30996838


</details>

<!-- generated by issue reporter -->
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 26, 2024
@karthiknadig
Copy link
Member

@shaoqx Please share your settings. specifically check what you have for formatOnType.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Mar 26, 2024
@shaoqx
Copy link
Author

shaoqx commented Mar 26, 2024

@karthiknadig Thank you! I found it is enabled by the Python extension. I was not able to turn it off for the workspace using the GUI but I did it via editing the .json
My problem has been resolved! Thank you!

@shaoqx shaoqx closed this as completed Mar 26, 2024
@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Mar 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants