microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.42k stars 29.34k forks source link

Creating new Class fails in SpringBoot project with error #146131

Closed rajinder-yadav closed 2 years ago

rajinder-yadav commented 2 years ago

We have written the needed data into your clipboard because it was too large to send. Please paste. Issue Type: Bug

Create a new SpringBoot project demo, use this as a starting point: https://github.com/rajinder-yadav/demo

Create a folder under "src/main/java/com/example" called controller. Select "controller" folder. press CTRL+SHIFT+P -> "java: new class file" Type in class name , "HelloController"

Get following error message

{"code":"0402","msg":"Failed to invoke [new java files], 
cannot get the effective active text editor or selected file!",
"msg_zh":"生成文件失败: 没有选中文件或者打开的编辑器!"}

snap-20220327-01

VS Code version: Code - Insiders 1.65.0-insider (3112460dc48ce7e557ea9feeaae04b912164b48b, 2022-02-24T05:16:07.860Z) OS version: Linux x64 5.16.15-1-default Restricted Mode: No

I would expected a new java class file created under the selected, "controller" folder.

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 2700X Eight-Core Processor (16 x 4200)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|1, 1, 1| |Memory (System)|62.71GB (32.15GB free)| |Process Argv|. --crash-reporter-id 210d9130-10f4-4cf9-ad76-187d60112fd6| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|/usr/share/xsessions/plasma5| |XDG_CURRENT_DESKTOP|KDE| |XDG_SESSION_DESKTOP|KDE| |XDG_SESSION_TYPE|x11|
Extensions (65) Extension|Author (truncated)|Version ---|---|--- terraform|4op|0.2.5 vscode-base64|ada|0.1.0 vscode-tomcat|ada|0.12.1 markdown-navigation|Ala|1.0.3 Bookmarks|ale|13.2.4 aws-toolkit-vscode|ama|1.37.0 ng-template|Ang|13.3.0 vscode-apollo|apo|1.19.9 vscode-tailwindcss|bra|0.7.7 dep|car|0.1.0 npm-intellisense|chr|1.4.1 path-intellisense|chr|2.8.0 bracket-pair-colorizer-2|Coe|0.2.4 vscode-markdownlint|Dav|0.46.0 vscode-eslint|dba|2.2.2 java-decompiler|dgi|0.0.3 java-debug|DSn|0.0.2 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.4.0 vscode-lombok|Gab|1.0.1 terraform|has|2.21.0 java-properties|ith|0.0.2 vscode-peacock|joh|4.0.1 sort-typescript-imports|mic|1.4.1 vscode-docker|ms-|1.21.0 python|ms-|2022.2.1924087327 vscode-pylance|ms-|2022.3.3 cpptools|ms-|1.9.7 live-server|ms-|0.2.12 vscode-typescript-tslint-plugin|ms-|1.3.3 angular2-inline|nat|0.0.17 vetur|oct|0.35.0 vscode-boot-dev-pack|Piv|0.1.0 vscode-manifest-yaml|Piv|1.32.0 vscode-spring-boot|Piv|1.32.0 platformio-ide|pla|2.4.3 java-ide-pack|pve|1.2.1 vscode-thunder-client|ran|1.14.1 fabric8-analytics|red|0.3.5 java|red|1.4.0 vscode-commons|red|0.0.6 vscode-xml|red|0.19.1 vscode-yaml|red|1.5.1 vue-vscode-snippets|sdr|3.1.1 markdown-preview-enhanced|shd|0.6.2 vscode-checkstyle|she|1.4.1 java-generate-setters-getters|soh|7.4.0 sonarlint-vscode|Son|3.3.3 sass-indented|syl|1.8.19 serverless-ide-vscode|Thr|0.5.33 find-then-jump|tra|2.0.5 sort-lines|Tyr|1.9.1 vscodeintellicode|Vis|1.2.17 vscode-java-debug|vsc|0.38.0 vscode-java-dependency|vsc|0.19.0 vscode-java-pack|vsc|0.22.1 vscode-java-test|vsc|0.34.2 vscode-maven|vsc|0.35.1 vscode-spring-boot-dashboard|vsc|0.3.0 vscode-spring-initializr|vsc|0.9.0 vscode-jumpy|wma|0.3.1 better-align|wwm|1.1.6 vscode-java-saber|You|0.1.2 markdown-pdf|yza|1.4.4 vscode-aspell|zap|0.1.4 (8 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392:30422396 pythontb:30258533 vsc_aa:30263845 pythonvspyt551cf:30291413 pythonptprofiler:30281269 vshan820:30294714 pythondataviewer:30285072 vscod805cf:30301675 pythonvspyt200:30323110 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30404738 wslgetstarted:30449409 vsclayoutctrt:30405800 pythonvspyt640:30438691 vscscmwlcmt:30428973 vscgsvid2:30433758 pynewfile477:30451556 ```
Lemmingh commented 2 years ago

/causedByExtension

Please read its docs carefully:

https://github.com/jiangdequan/vscode-java-saber/blob/bef83f2904800e4961a04971425501a643876569/README.md#new

Method 2: You must open a java file in text editor

gjsjohnmurray commented 2 years ago

/extJava