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

Implement WorkspaceEditMetadata and add new preference for autosave on refactoring #12193

Conversation

jonah-iden
Copy link
Contributor

What it does

resolves #12018
this implements WorkspaceEditMetadata for the vscode api and adds "files.refactoring.autoSave" as a new preference for autosaving all affected files after applying a refactoring, when normal autosave is disabled and the refactoring is marked as such through WorkspaceEditMetadata .

How to test

You can find a test extension here: https://github.com/jonah-iden/workspace-metadata-test
or download it here: workspace-metadata-test-0.0.1.zip

steps to test

  1. Install extension
  2. Turn files.autoSave to off, files.refactoring.autoSave should be true by default
  3. Open at least two files
  4. Execute apply workspaceEdit with refactoring. See files should have been saved since the edit was marked as refactoring.
  5. Execute apply workspaceEdit without refactoring. Edit should have been applied but files should have not been saved

Review checklist

Reminder for reviewers

@msujew msujew changed the title implemented WorkspaceEditMetadata and added new preference for autosave on refactorings Implement WorkspaceEditMetadata and add new preference for autosave on refactoring Feb 17, 2023
Signed-off-by: Jonah Iden <[email protected]>
@JonasHelming JonasHelming added the vscode issues related to VSCode compatibility label Feb 20, 2023
Signed-off-by: Jonah Iden <[email protected]>
Signed-off-by: Jonah Iden <[email protected]>
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extensions works well, I have some comments though, see below.

packages/editor/src/browser/editor-preferences.ts Outdated Show resolved Hide resolved
packages/plugin-ext/src/common/plugin-api-rpc.ts Outdated Show resolved Hide resolved
packages/monaco/src/browser/monaco-workspace.ts Outdated Show resolved Hide resolved
packages/monaco/src/browser/monaco-workspace.ts Outdated Show resolved Hide resolved
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vscode] support WorkspaceEditMetadata
4 participants