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

Set extensionKind in package.json to support Remote Development #870

Closed
mjbvz opened this issue May 2, 2019 · 5 comments
Closed

Set extensionKind in package.json to support Remote Development #870

mjbvz opened this issue May 2, 2019 · 5 comments

Comments

@mjbvz
Copy link
Contributor

mjbvz commented May 2, 2019

Hi, I'm on the VS Code team. We recently released support for Remote Development and I noticed that your may extension need a small change to ensure users have a good experience when using it remote workspaces.

What is the issue?

To make remote development as transparent as possible to users, VS Code distinguishes two classes of extensions:

  • UI Extensions: These extensions make contributions to the VS Code user interface and are always run on the user's local machine. UI Extensions cannot directly access files in the workspace, or run scripts/tools installed in that workspace or on the machine. Example UI Extensions include: themes, snippets, language grammars, and keymaps.

  • Workspace Extensions: These extensions are run on the same machine as where the workspace is located. When in a local workspace, Workspace Extensions are run on the local machine. When in a remote workspace, Workspace Extensions are run on the remote machine. Workspace Extensions can access files in the workspace to provide rich, multi-file language services, debugger support, or perform complex operations on multiple files in workspace (either themselves or by invoking scripts/tools).

You can find more details about this architecture here.

VS Code currently infers that your extension is a Workspace Extension. This means that users who have your extension installed must also install it to the remote in order to use it in remote workspaces. I believe that your extension should probably be a UI extension instead. That way your extension will always be enabled for users who install it, even if they open a remote workspace.

How do I fix this?

To tell VS Code that your extension is a UI extension, just add "extensionKind": "ui" to your extension's package.json.

UI Extensions always run on the user's local machine, even when they open a remote workspace.

I'll submit a PR that does this. Please let me know if you have any questions or concerns about the issue. We've also put together a guide to help you test your extension in remote workspaces

PS: As a temporary workaround for a few popular extensions, we've automatically added your extension to an internal whitelist so that is always treated as a UI extension

mjbvz added a commit to mjbvz/code-settings-sync that referenced this issue May 2, 2019
@shanalikhan shanalikhan added this to the v3.3.0 milestone May 3, 2019
@shanalikhan
Copy link
Owner

Thanks.
I will release this fix in the upcoming version.

Feel free to send PR where you think it can be improved. :)

shanalikhan pushed a commit that referenced this issue May 3, 2019
@brysgo
Copy link

brysgo commented May 10, 2019

@shanalikhan - thanks for this extension, I'm using it to do development on WSL using the remote WSL extension, but all my extensions that run in WSL don't get synced because they are installed on the remote. What is the remediation for this?

@jraviotta
Copy link

jraviotta commented Jun 5, 2019

Adding this issue here as it is likely a WSL compatibility issue.

I am using code-insiders to take advantage of remote development. When I install settings sync in WSL, settings sync fails to sync with Cannot read property 'ignoreUploadFolders' of undefined.

I tried resetting the defaults, uninstalling/reinstalling the extension, but get the same error.

FYI: I copied contents of %APPDATA%/Code/User/syncLocalSettings.json to %APPDATA%/Code - Insiders/User/syncLocalSettings.json and had the same issue.

@shanalikhan
Copy link
Owner

@brysgo and @jraviotta

I would suggest you to create new issue regarding WSL compatibility with your real time detail senarios with the bugs ( logs or image attached ) rather than description. This issue is fixed and will be release in upcoming release.

shanalikhan pushed a commit that referenced this issue Jul 1, 2019
* Updated to task api 2.0.0 and fixed tests

* Set "extensionKind": "ui" to support remote development #61

Fixes #870. See that issue for details

* Clean up previous commits into one

* #800 #515 #854

* Utilized pragmaUtil Functions for kb.json file

* Typo fix

* Added universalKeybindings setting

* chore(package): update @types/node to version 12.0.0 (#873)

* Cleaned up toggling commented settings (#877)

* Cleaned up toggling commented settings

* Updated to include fix by @ioprotium

* Fix warning with webpack

* Update UI

* Change height to max-height

* Add image locally and move it to the top

* Added documentation for tests in CONTRIBUTING.md (#881)

* fix(package): update fs-extra to version 8.0.0 (#882)

* chore(package): update @types/fs-extra to version 7.0.0 (#885)

* chore(package): update @types/node to version 12.0.1 (#883)

* fix(package): update fs-extra to version 8.0.1 (#884)

* Update UI to fit guidelines

* chore(package): update @types/node to version 12.0.2 (#887)

* Improve UI and functionality

* Match BG of theme and properly contrast text

* Fix issues with themes

* Fix image not showing up with light theme

* Fix issues with contrast

* Fix issue with VS Code's WebView

* Update UI and functionality

* Fix potential issue with light themes

* Fix issues with theme on modal

* Refactor

* Add new (but experimental) localizations (#898)

* chore(package): update clean-webpack-plugin to version 3.0.0 (#899)

*  #891

* Update settings page after a reset

* Improve code

* fix(clean-webpack-plugin): (#901)

clean-webpack-plugin was recently updated, and it had breaking changes.

* chore(package): update @types/node to version 12.0.3 (#897)

* #668

* fix(OSS):

enums.ts
----
Allow for setting os type with less code

environmentPath.ts
----
Find code folder and extensions folder more efficiently
Get OS type more efficiently

settings.ts
----
Ignore all state files

sync.ts
----
Adapt for changes in pluginService

pluginService.ts
----
Use vscode command to install extensions
Clean up code and simplify names

* Install extensions in order

* Comment legacy code instead of deleting it

* Fix extension install

* Fix issue with extensions always being deleted

* Get code path more efficiently

* Make sure to escape spaces in cli path

* Fix issues with portable builds

* Support Windows and certain editions

* Improve method for finding extension folder

* Start using API for installation

* Prepare for new API command

* Get ready for new API command

* Fix issue with installation

* Commit requested changes

* #668

* Format pluginService.ts (#906)

* #668

* Throw error

* Try to fix issues with getting missing

* chore(package): update @types/node to version 12.0.7 (#904)

* chore(package): update @types/node to version 12.0.8 (#908)

* #668

* #668

* #668

* #839

* Support multiple instances

* Completely switch to state

* Update to work properly

* Move setting classes to their own models

* Update service names

* Only auto upload using focused window

* Resolve merge conflicts

* #886

* Resolve locale properly

* Clean constructor

* Use state instead of passing in argument

* Update to be compatible with v3.3.0 changes

* Fix readme

* Fix package.json

* Add new settings

* Increase contrast

* Update

package.nls.*.json
----
Add localizations for setting names and placeholders.

github.oauth.service.ts
----
Handle errors in a more user-facing way
Support GitHub enterprise
Show message to user after success

webview.service.ts
----
Use new localizations for names and placeholders

* Bug fix and upload images

* Add support for commits to master (release notes)

* Fix issue

* Fix another issue with release notes

* Update release note template

* Update release notes

* Don't open gist selection if there aren't any gists

* Allow user to view gist

* Revert accidental change

* Support public gist

* Add css, js, and fonts to repo

* Improve font injection

* Revert accidental change
@Dreomite
Copy link

@shanalikhan - thanks for this extension, I'm using it to do development on WSL using the remote WSL extension, but all my extensions that run in WSL don't get synced because they are installed on the remote. What is the remediation for this?

It's still not supported by this extension. I came up with 2 workarounds:

  1. Install all the extensions locally then open WSL session and use recently introduced feature to automatically install all appropriate extensions in WSL.

    Pros:

    • Very easy to do.

    Cons:

    • Deleted extensions won't be synchronized and will have to be deleted manually on all machines.
    • Possibly unwanted extensions installed locally.
  2. Paste this to your remote settings and then reload VSCode:

    "sync.gist": "your_separate_settings_gist_id_here234233523",
    "remote.extensionKind": {
      "shan.code-settings-sync": "workspace"
    },
    

    After this, when you're connected to WSL, Settings Sync will be considered a remote extension. Install it on WSL and reload VSCode again. Now just provide Settings Sync with your GitHub token and you're good to go. When connected to WSL, it will sync your WSL extension list, in local sessions, regular things will be synchronized.

    Pros:

    • Avoid bloating your local client with unwanted extensions.
    • Separate configs for different purpose WSLs.

    Cons:

    • Synced data is usable only for WSL (and, probably, any other code-server implementations).
    • The only thing that is synchronized is extensions list. Any other things, including settings, are not.

Warning: When using the second method, don't try to load settings from your main gist to WSL. It will fuck up your code-server installation.

There was an issue opened for remote server support in this extension (#913), but @shanalikhan probably misinterpreted it and closed it. Perhaps it should be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants