microsoft / vscode-maven

VSCode extension "Maven for Java"
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven
Other
182 stars 89 forks source link

why is a new window created when opening created java project #930

Closed rajinder-yadav closed 1 year ago

rajinder-yadav commented 1 year ago

Type: Bug

When I create a new java project using maven. VSCode at the end will ask

When I select Open, why is a new windows created? I then need to go and close the other window which has no projects in it.

I usually just start vscode from the command line in an empty folder and then create the java project there.

It is lame, if someone needs to open an existing project, just to create a new project and then a new windows had to open up. I really don't see a need for this behaviour. I just rather have the current vscode load the newly created java project.

In the end I am forced to close the other windows all the time, this gets annoying ovetime.

Extension version: 0.40.3 VS Code version: Code - Insiders 1.75.0-insider (11238faea62d570d77afe6edfe05c8b732c44a2b, 2022-12-13T05:22:26.937Z) OS version: Linux x64 6.1.3-1-default Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900X 12-Core Processor (24 x 3997)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|0, 1, 1| |Memory (System)|62.72GB (43.45GB free)| |Process Argv|/home/yadav/dev/docs/guides --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|
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30422396 pythontb:30258533 vsc_aa:30263845 pythonptprofiler:30281269 vshan820:30294714 pythondataviewer:30285072 vscod805cf:30301675 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30404738 cppdebug:30492333 vsclangdf:30492506 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30618038 pylantcb52:30590116 pyindex848:30611229 nodejswelcome1:30587009 pyind779:30611226 pythonsymbol12:30622696 fim-prod:30623723 ```
Eskibear commented 1 year ago

I then need to go and close the other window which has no projects in it.

If you have an empty window with no folder in it, you won't see the "Add to current workspace" option. And "Open" just opens the project in current window.

See https://github.com/microsoft/vscode-maven/blob/005876e41d1622ad1279ae9daa5cab7a8d8f75e5/src/extension.ts#L309-L313

Please double confirm about the behavior as described above, checking whether there's any bug in it.

BTW, there is a setting maven.projectOpenBehavior, with which you can change the behavior base on your own taste.

rajinder-yadav commented 1 year ago

OK I am opening vscode inside a non-empty folder. However I am not opening vscode by opening an existing project.

In this case, this plugin should know via vscode there is no existing (java) project opened. So when I create a new java project, at the end, it is just opened in the current vscode session.

Right now this is not what is happening.

Eskibear commented 1 year ago

In this case, this plugin should know via vscode there is no existing (java) project opened

First, it's cheap to know whether it's an empty workspace or not, but it's not cheap to check whether there are .java files in current workspace. Second, some others working on multi-language projects might not want to close current non-Java project. Closing current session would cause big trouble for them, while always open new projects in new windows doesn't block you. If you want to close current session, go ahead to close it with a single click.

Thus I don't think we'll make the change.