rxliuli / joplin-utils

Joplin-based community tool
https://joplin-utils.rxliuli.com/
MIT License
236 stars 36 forks source link

[Feat]: Support extension running on host #26

Closed hwine closed 2 years ago

hwine commented 2 years ago

app

joplin-vscode-plugin

Is your feature request related to a problem? Please describe.

Currently, the vscode plugin will only run on the remote host, so will not work with Joplin running locally for remote workspaces. Error message: image

My setup is Windows 10 (or macOS), where I run Joplin, VSCode and other gui apps. My code development all happens in remote containers (wsl2 & docker). I can only connect to my Joplin instance from a local workspace.

Describe the solution you'd like

I'd like to be able to utilize the Joplin extension, running locally, even when my VS-Code workspace is remote.

Describe alternatives you've considered

I can only use the plugin in a local workspace, which must be in a separate window. That mode provides no advantages over using the native windows Joplin app.

Additional context

From what I've seen on other extensions, this may be just a configuration setting when you build. E.g. image

rxliuli commented 2 years ago

You are right

https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location

rxliuli commented 2 years ago

You can add configuration to force the extension to run locally

{
  "remote.extensionKind": {
    "rxliuli.joplin-vscode-plugin": [
      "ui"
    ]
  },
}

But there are still some problems. The main reason is that the action of opening notes is completed by joplin, so you need to configure joplin's text editor command to support opening in the current remote development window (by default, it will open in a new window, which is very strangeness...)

https://user-images.githubusercontent.com/24560368/146629678-a3fb535e-5ec0-43c8-9f9d-7372bf92bb91.mp4

Maybe you know how to use vscode to add parameters from the command line to specify it to be opened in the remote vscode window?

image

hwine commented 2 years ago

I'll try to see what I can get going -- the issue may be (for me) that Joplin.exe may not accept any command line arguments. (It doesn't respond to any of the usual ways to invoke a quick "help" output.)

BTW, where would I put the config lines you mention? I don't see anything similar in settings.json, so I suspect it'd be in the manifest, which means cloning, etc. I don't think I need a dev setup yet.

rxliuli commented 2 years ago

I'll try to see what I can get going -- the issue may be (for me) that Joplin.exe may not accept any command line arguments. (It doesn't respond to any of the usual ways to invoke a quick "help" output.)

I mean, do you know how to open a file in the vscode remote window via the command line? By default vscode will open a local window

https://user-images.githubusercontent.com/24560368/146862786-a2c7d8d7-55f2-462f-bb69-f1268ad39395.mp4

BTW, where would I put the config lines you mention? I don't see anything similar in settings.json, so I suspect it'd be in the manifest, which means cloning, etc. I don't think I need a dev setup yet.

The configuration is just the configuration file of vscode, there should be a button Go to settings.json from the settings

image image

hwine commented 2 years ago

I mean, do you know how to open a file in the vscode remote window via the command line? By default vscode will open a local window

Oh - at that level - no I don't, but it must be possible, as settings.json at the user level is always local. I hope that's not a privileged operation.

The configuration is just the configuration file of vscode, there should be a button Go to settings.json from the settings

Got it -- it's a top level object. (I didn't know if it was nested under something.)

rxliuli commented 2 years ago

You can try 0.7.2, it should fix the problem

https://github.com/rxliuli/joplin-utils/releases/tag/joplin-vscode-plugin%400.7.2