SimpsonGSD / P4EditVS

Simple, lightweight Visual Studio plugin to run various Perforce commands on files, such as checkout and revert. Includes optional auto-checkout feature.
https://marketplace.visualstudio.com/items?itemName=ScottSimpson.p4editvs
MIT License
32 stars 8 forks source link

Automatic connection to the last workspace #7

Closed EugeneFominPlaywing closed 3 years ago

EugeneFominPlaywing commented 3 years ago

Hello! First of all, I use Workspaces instead of 'Allow Environment' functionality. I noticed that when I specify workspace in settings, it successfully saves and after reload we can see it again. To work in certain workspace, I have to select it in Extensions -> P4EditVS -> [MyWorkspaceName]. But when I close my project and reopen it later, I notice that I still have to select it in Extensions (see screenshot below). It would be good if you add option 'Default Workspace on startup' which connects to specified workspace automatically on vs load (because I always set it manually)

image

Thank you!

SimpsonGSD commented 3 years ago

Hi Eugene I'm struggling to reproduce this. Here's what I'm doing, in case I am misunderstanding the issue.

Visual Studio options: image

Repro steps:

  1. Open VS2019, load Solution X.
  2. Go to Extensions -> P4EditVS
  3. Observe selected workspace is "1"
  4. Change selected workspace to "2"
  5. Close VS2019
  6. Open VS2019, load Solution X.
  7. Go to Extensions -> P4EditVS
  8. Observe selected workspace is now "2"

You are saying that in step 8 the selected workspace is still "1" ?

EugeneFominPlaywing commented 3 years ago

I'm saying that after step 6 (Open VS2019, load Solution X) and 7 (Go to Extensions -> P4EditVS) none of workspaces selected. It seems like my selection was not saved. Maybe you cannot reproduce it because you filled all the workspaces in options (I might be wrong).

SimpsonGSD commented 3 years ago

I can see there is an issue when you have no .suo file and Allow Environment unchecked - there will be no default workspace selected. But after selecting one, closing and reopening there is one selected. I only had filled out 3 workspaces in the above test.

Can you confirm the VS version you are on? Can you confirm you have a .suo file in the .vs folder for your solution? If possible can you delete or rename your .suo and repeat the steps to see if that fixes the issue?

EugeneFominPlaywing commented 3 years ago

Microsoft Visual Studio Community 2019 Version 16.8.4

.suo file exists deleted .suo file (yeah, it was correct .suo file, it generated when I ran VS again) - didn't help

SimpsonGSD commented 3 years ago

Ok I am on 16.8.3 I will updated to 16.8.4 and re-test.

EugeneFominPlaywing commented 3 years ago

Nice, thank you :-)

SimpsonGSD commented 3 years ago

This still seems to work in 16.8.4 after deleting my .vs folder and Allow Environment set to False with only one workspace filled in. There is an oddity if you open, change the workspace and close in quick succession as it doesn't always write to the suo file on close. So you can lose the selected workspace in that instance.

I'm not sure why this isn't working for you, I do plan to move away from suo files which would hopefully solve this for you.

I'd suggest trying to use the environment settings to get around this for now. If you only use one workspace that should be fine.

EugeneFominPlaywing commented 3 years ago

Understood! Thank you very much, I will wait for the updates :-)

SimpsonGSD commented 3 years ago

Hi @EugeneFominPlaywing I have moved the saved workspace out of the suo file. Please try version 2.3 and let me know if this issue can be closed. Thanks, Scott.

EugeneFominPlaywing commented 3 years ago

Works fine, thank you very much!