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

External code-workspace file changes not picked up until reload #68351

Closed
iciclesoft opened this issue Feb 10, 2019 · 11 comments · Fixed by #69174
Closed

External code-workspace file changes not picked up until reload #68351

iciclesoft opened this issue Feb 10, 2019 · 11 comments · Fixed by #69174
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded workbench-multiroot Multi-root (multiple folders) issues
Milestone

Comments

@iciclesoft
Copy link

Issue Type: Bug

Changes to the .code-workspace file by external sources (extensions/manual edit) are not picked up anymore until VSCode is relaunched. For instance, if you use notepad to add a workspace folder to the .code-workspace file, VSCode won't show the new workspace folder until the workspace is relaunched in VSCode. This also means that if you then add another workspace folder through VSCode, and save the workspace, the workspace folder added with notepad is removed. Using the Refresh Explorer button doesn't trigger a re-read of the .code-workspace file either. This renders the extension WorkspaceSort rather useless.

VS Code version: Code 1.31.0 (7c66f58, 2019-02-05T22:35:56.624Z)
OS version: Windows_NT x64 10.0.17134

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Create a new workspace
  2. Add 2 folders to the workspace, called B and A
  3. Save the workspace
  4. Edit and save the .code-workspace file, changing the order of the folders using notepad or the extension WorkspaceSort
  5. Notice that the order in VSCode has not been changed
  6. Close and reopen VSCode, notice that the order in VSCode did change
@vscodebot
Copy link

vscodebot bot commented Feb 10, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@bpasero
Copy link
Member

bpasero commented Feb 11, 2019

I was not able to reproduce this on macOS at least.

@bpasero bpasero added the file-explorer Explorer widget issues label Feb 11, 2019
@iciclesoft
Copy link
Author

In the screenshot below you can see that VSCode shows a different order of the folders than the .code-workspace file.

folder-test

@isidorn
Copy link
Contributor

isidorn commented Feb 18, 2019

@iciclesoft Can you reproduce this with latest vscode insiders?
https://code.visualstudio.com/insiders/

@isidorn isidorn added the info-needed Issue requires more information from poster label Feb 18, 2019
@iciclesoft
Copy link
Author

@isidorn Yes, I can. The screenshot below shows the difference in the order of the folders between the content of the .code-workspace file within the latest insiders, in this case there are also no extensions active. Changes are not shown in VSCode until it is restarted.

folderorderinsiders

@isidorn
Copy link
Contributor

isidorn commented Feb 19, 2019

I can reproduce this also on the mac.
The issue here is that the contextService does not fire a onDidChangeWorkspaceFolders event when the order of workspace roots is changed in the code-workspace file. Since the order changed I would expect this event to arrive.
Thus forwarding to @bpasero and @sandy081

@isidorn isidorn assigned bpasero and sandy081 and unassigned isidorn Feb 19, 2019
@isidorn isidorn removed file-explorer Explorer widget issues info-needed Issue requires more information from poster labels Feb 19, 2019
@bpasero bpasero removed their assignment Feb 19, 2019
@bpasero bpasero added workbench-multiroot Multi-root (multiple folders) issues bug Issue identified by VS Code Team member as probable bug labels Feb 19, 2019
@bpasero
Copy link
Member

bpasero commented Feb 19, 2019

@sandy081 could be the case of a missing file event (given I could not reproduce when I tried on macOS), if so, please forward back to me.

@isidorn did you check if the file event made it through? --verbose

@isidorn
Copy link
Contributor

isidorn commented Feb 19, 2019

@bpasero The file event does not seem to go through. if I start out of source with --verbose flag.

@bpasero bpasero assigned bpasero and unassigned sandy081 Feb 19, 2019
@bpasero bpasero added workbench-multiroot Multi-root (multiple folders) issues and removed workbench-multiroot Multi-root (multiple folders) issues labels Feb 19, 2019
@bpasero
Copy link
Member

bpasero commented Feb 19, 2019

@sandy081 I assume you setup custom file watching for the workspace file right? Where is that code? Does it check for changes?

@sandy081
Copy link
Member

I think this would have caused by my changes moving away from node based file watching to file service watch. Will investigate further and figure it out.

@iciclesoft
Copy link
Author

Thanks for the fix, I just tested it in the new insiders build and everything seems to be working correctly. I am looking forward to the next release!

@RMacfarlane RMacfarlane added the verified Verification succeeded label Feb 27, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants