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

fix #7269: complete support vscode.workspace.fs API #7908

Merged
merged 1 commit into from
Aug 3, 2020

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented May 27, 2020

What it does

This PR replaces our filesystem implementation with VS Code one to provide first class support for different fs providers and features like dealing with encoding, cross provider operations, support working copy modifications and so on.

  • porting VS Code implementation
    • FileSystemService
      • activation event
    • DiskFileSystemProvider
    • RemoteFileSystemProvider
    • WorkingCopyFileService
    • TextFileService
    • EncodingOracle
      • support encoding overrides
    • file a CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22318
    • add copyright comments
    • add links to copied code as comments
  • adjusting clients
    • Extension Host Process
    • FileTree, FileTreeModel
    • FileTreeDialog
    • Explorer
    • FileSystemFrontendContribution
    • Resource
    • MonacoTextModel
    • DebugConfigurationManager
    • FileDialogService
    • FileDownloadHandler
    • GitDiffContribution
    • MonacoWorkspace
    • NavigatorDiff
    • DialogsMainImpl
    • ScmHistoryWidget
    • SearchInWorkspaceFrontendContribution
    • TaskConfigurationManager
    • TerminalFrontendContribution
    • TerminalLinkmatcherFiles
    • DiffService
    • QuickOpenWorkspace
    • WorkspaceCommands
    • WorkspaceFrontendContribution
    • WorkspaceService
    • GitQuickOpenService
    • MiniBrowserContent
    • MiniBrowserEndpoint
    • HostedPluginSupport (browser) and PluginPathsServiceImpl (node)
    • PreferencesContribution
    • MonacoSnippetSuggestProvider
    • MonacoThemingService
    • PluginIconThemeService
    • GitScmProvider
    • WorkspaceDeleteHandler
    • DebugSession
    • ScmQuickOpenService
    • WorkspaceVariableContribution
    • GitRepositoryProvider
    • MarkerManager
  • deprecating Theia services
    • FileSystem
      • move getCurrentUserHome to EnvVariableServer
      • move getDrives to EnvVariableServer
    • FileSystemWatcher
    • replace UserStorageService with userdata fs provider
      • hook vscode-userdata and vscode-remote fs providers delegating to userstorage and file schemes
      • make sure that user storage paths are absolute
    • remove FileSystemNode, FileSystem should NOT be bound on the backend since it reflects user triggered operations
      • what about FileSystemNodeOptions? is it not used in practice and there are user preferences to control trash and encoding
    • stub FileSystem on frontend with FileService
    • stub FileSystemWatcher with FileService
      • what about FileShouldOverwrite? review create/write places and apply overwrite logic
    • document in breaking changes
  • preferences
    • files.watcherExclude
    • files.enableTrash
      • DiskFileSystemProvider should support useTrash then
    • files.encoding
    • files.autoGuessEncoding
    • files.participants.timeout
  • fix tests
  • fix vscode api tests

Out of scope:

How to test

  • file dialogs:
    • open and save dialogs should still work
    • open and save dialogs should work when triggered from VS Code extensions
    • displaying drivers should work
  • file encoding:
    • reopen with encoding should work
    • save with encoding should work, after save reopening the editor should detect the proper encoding
    • changing the default encoding should work, but utf8 should be used for setting files always
  • dirty state management
    • on file delete dirty editors should be marked as deleted
    • on file delete not dirty editors should be closed
    • on file add a deleted marker should be removed from dirty editors
    • on file move by a user editors should be moved
    • on file move by a system or api editors should be marked as deleted
  • navigator
    • restoring nodes of old format should work
    • copy/move should work
    • moving files between folders is reflected properly
    • disk file changes are reflected properly
    • Select for Compare and Compare with Selected commands should work
    • should be possible to download single file
    • should be possible to download multiple files
  • workspace management
    • open file and open with...
    • open folder
    • open workspace
    • close workspace
    • open recent workspace
    • new file/folder
    • save file
    • save file as...
    • file(s) rename
    • file(s) delete
    • file(s) duplicate
    • compare with each other
    • add/remove folders to/from a workspace
    • save a workspace file
    • workspace roots should be watched
    • files should be excluded according to files.watcherExclude from watching
  • Git Diff: Compare with... command should work
  • keeping fs watching after reconnection
  • fs changes from providers (disk)
    • add
    • update
    • delete
  • fs changes from users
    • create
    • move
    • delete
    • copy
  • text editors
    • read/write content (editors, preferences, search in workspace replace preview for a node)
    • no performance degradation on save (large files, incremental updates)
    • bulk resource edits should be applied, i.e rename ts class
    • out of sync
  • preferences
    • creating new launch.json
    • opening and creating tasks.json file should work
    • opening settings files from the preference view should work
    • opening new JSON file from the preference view should work
  • source control
    • open the history for files from the navigator
    • Git: Clone command should work
    • Git: Discard All Changes command should work
    • SCM: Change Repository... command should work
    • git repositories should be refreshed on changes in the workspace
  • search in workspace
    • Find in Folder command should work from the navigator
  • terminal
    • open in terminal should work from the navigator for files and folders
    • directory URIs should not match, but file URIs should
  • preview (mini browser)
    • refreshing on file changes should work
    • fetching various files should work, i.e. html, images, svg and so on
  • vscode extensions
    • storing global and workspace data should work
    • restoring existing global and workspace data should work
    • snippets should be properly loaded from the disk
    • themes should be properly loaded from the disk
    • icon themes should be properly loaded from the disk and applied for the file and
      • watchable icon themes are reloaded on the disk changes
    • python (disk fs access) - https://github.com/microsoft/vscode-python/releases/tag/2020.5.86806 (last version which does not require custom editors API)
    • typescript (fs events from users)
    • java (fs events from users)
  • task/debug
    • navigation to the loaded node modules should work from the stack view
    • cwd, workspaceFolder, workspaceRoot, and file variables should be resolved properly
  • problems
    • markers should be removed if a file or a parent folder is deleted

Review checklist

Reminder for reviewers

@akosyakov akosyakov force-pushed the akosyakov/integrate-vscode-api-7269 branch 6 times, most recently from 6c9058c to f207756 Compare May 28, 2020 13:33
@akosyakov akosyakov added filesystem issues related to the filesystem vscode issues related to VSCode compatibility labels May 28, 2020
@akosyakov akosyakov force-pushed the akosyakov/integrate-vscode-api-7269 branch 8 times, most recently from fc13654 to b80c7a9 Compare June 3, 2020 13:02
@akosyakov akosyakov force-pushed the akosyakov/integrate-vscode-api-7269 branch 14 times, most recently from d8151fe to 4009dcc Compare June 10, 2020 09:41
@akosyakov
Copy link
Member Author

akosyakov commented Jul 14, 2020

@marcdumais-work Is it mandatory for us to wait till CQs where we know that code is under MIT to be approved by the foundation? I remember we discussed that we could merge it and do occasional checks of the whole VS Code? It takes too long and no response from them.

btw it looks like there are already solutions in the wild based on this PR: https://twitter.com/plotlygraphs/status/1281672032955047938 Notebooks cannot work without this PR.

@marcdumais-work
Copy link
Contributor

marcdumais-work commented Jul 14, 2020

Is it mandatory for us to wait till CQs where we know that code is under MIT to be approved by the foundation?

Yes, I think we need to wait for CQs about copied code, unless given permission to merge while they finish their investigation (so-called "parallel IP*"). The main vscode repo's license is indeed MIT, but there are bits that are under different licenses. So depending what exactly we copy, it could have an impact. I've pinged the PMC on the CQ, asking to be granted parallel IP.

I remember we discussed that we could merge it and do occasional checks of the whole VS Code? It takes too long and no response from them

Yes, that was a proposal by the foundation, for them to deep-analyse whole versions of vscode, making them pre-approved, for us to use/fork (in theory). I think there was an assumption that this would not need to happen too often (i.e. not every vscode release) and that we would/could use these few pre-approved versions most of the time. So maybe more a way to save work for the Foundation, rather than make it more efficient for us :)

In this PR it looks like you copy from the as-of-yet unreleased (at CQ creation time) 1.47.0 version, so it probably would not have helped.


(*): from the Eclipse Project Handbook:

What is Parallel IP?

The parallel IP Process allows an Eclipse projects to make use of project code 
contributions and third-party content before they are fully approved by the Eclipse
IP Team. In versions of the IP Policy prior to 2019, projects needed to meet 
specific requirements to be able to leverage the Parallel IP. This is no longer the 
case: full vetting is now always applied in parallel in all cases.

Copy link
Contributor

@tsmaeder tsmaeder left a comment

Choose a reason for hiding this comment

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

Looking forward to seeing this PR get merged. I have mostly questions, with a few suggestions sprinkled in.

packages/core/src/common/event.ts Outdated Show resolved Hide resolved
packages/core/src/common/uri.ts Show resolved Hide resolved
packages/plugin/src/theia.d.ts Outdated Show resolved Hide resolved
@akosyakov
Copy link
Member Author

@tsmaeder thank your for the review! I will work through comments next week.

CQ was approved btw, so maybe we can land it end next week.

@akosyakov akosyakov force-pushed the akosyakov/integrate-vscode-api-7269 branch from 5cf3072 to f408df3 Compare July 27, 2020 13:07
@akosyakov
Copy link
Member Author

akosyakov commented Jul 27, 2020

@tsmaeder I've addressed your comments. Could you have a look please?

@eclipse-theia/ecd-theia-committers CQ is approved, I would like to merge it after next release, i.e. this Thursday if no objections... should not forget to bump up the version in CHANGELOG and rebase once more after the release

@akosyakov akosyakov force-pushed the akosyakov/integrate-vscode-api-7269 branch from f408df3 to 2698007 Compare July 28, 2020 11:52
@tsmaeder
Copy link
Contributor

@akosyakov all my comments are resolved.

@akosyakov akosyakov force-pushed the akosyakov/integrate-vscode-api-7269 branch from 2698007 to 87c7840 Compare July 28, 2020 13:48
@akosyakov akosyakov force-pushed the akosyakov/integrate-vscode-api-7269 branch from 87c7840 to a8d9c09 Compare August 3, 2020 08:12
@akosyakov akosyakov merged commit 8bf15dc into master Aug 3, 2020
@akosyakov akosyakov deleted the akosyakov/integrate-vscode-api-7269 branch August 3, 2020 08:52
@yunuscukran
Copy link

@akosyakov
Copy link
Member Author

@yunuscukran updated guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) filesystem issues related to the filesystem vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants