golf1052 / code-sync

Sync VSCode extensions using your favorite file synchronization service (OneDrive, Dropbox, Google Drive, etc.)
https://marketplace.visualstudio.com/items?itemName=golf1052.code-sync
MIT License
34 stars 3 forks source link

Code was not found on your path #41

Open convexshiba opened 4 years ago

convexshiba commented 4 years ago

If you are reporting an issue/bug please fill in your VSCode version, CodeSync version, and if you are on version 2.4.0 and above the CodeSync log from the CodeSync output channel. Thanks!

If you are requesting a feature feel free to clear this template.

VSCode version:

CodeSync version:

CodeSync log:

Issue:

Screen Shot 2020-04-18 at 3 26 25 PM

Our company uses a customized version of vscode and has a different command, so instead of code, we have other variant, for example codeabcdefg.

Can we make this configurable as a setting?

Thanks!

golf1052 commented 4 years ago

Does the customized version use different paths for the extensions directory, settings directory, etc?

convexshiba commented 4 years ago

Unfortunately yes, since the application's name is also different.

For example my settings's path is $HOME/Library/Application Support/[VSCODE CUSTOM APPLICATION NAME THAT CONTAINS THREE SPACES]/User/settings.json

But other than application name, I don't find anything else different.

convexshiba commented 4 years ago

Hi, sorry to chase on this.

Is there any relevant code pointer? I can try figuring out how to add this.

golf1052 commented 4 years ago

Sorry it took me a while to get to this, I just published 2.7.0 which lets you set the VSCode executable name and the VSCode user settings path. The new commands are

CodeSync: Set VSCode executable name
CodeSync: Set VSCode settings path

Update to the latest version and let me know if it works.

convexshiba commented 4 years ago

Thank you for adding the support so fast!

Sorry it didn't work right out of the gate.

When I reinstall the extension, I saw this in my console:

Activating extension 'golf1052.code-sync' failed: ENOENT: no such file or directory, open '/Users/username/.custom-vscode-path/extensions/golf1052.code-sync-2.7.0/settings.json'.

_logMessageInConsole @ workbench.desktop.main.js:202855

Then I went there and checked that the settings.json indeed doesn't exist.

Then I touched a empty "{}" file named settings.json there.

After Reload Window I see this:

Extension Host
workbench.desktop.main.js:221932 /bin/sh: code: command not found

I think this is the usual, expected message.

Then I use Command Pellate to do setexecutable

Then in console:

workbench.desktop.main.js:152357 Command 'CodeSync: Set VSCode executable name' resulted in an error (command 'codeSync.setCodeExecutableName' not found)

onDidChangeNotification @ workbench.desktop.main.js:152357
(anonymous) @ workbench.desktop.main.js:152345
fire @ workbench.desktop.main.js:5723
addNotification @ workbench.desktop.main.js:154368
error @ workbench.desktop.main.js:221152
accept @ workbench.desktop.main.js:142022
processTicksAndRejections @ internal/process/task_queues.js:85
async function (async)
accept @ workbench.desktop.main.js:142018
(anonymous) @ workbench.desktop.main.js:96532
fire @ workbench.desktop.main.js:5723
(anonymous) @ workbench.desktop.main.js:68168
fire @ workbench.desktop.main.js:5723
(anonymous) @ workbench.desktop.main.js:68603

Not entirely sure what went wrong.

Should I seed settings.json with some default params?

Thanks!

golf1052 commented 4 years ago

Yep after deploying I also ran into this bug, I'm just testing the fix now. 2.7.1 should be available shortly.

golf1052 commented 4 years ago

2.7.1 is now released. try that.

convexshiba commented 4 years ago

In my 2.7.1 folder I have a empty settings.json file. I didn't create it so I assume it comes with the install.

But in console I saw:

Activating extension 'golf1052.code-sync' failed: The "path" argument must be of type string. Received type undefined.
_logMessageInConsole | @ | workbench.desktop.main.js:202855

Then I went to settings.json and manually added a

    "path": "/usr/local/bin/custom_path"

that didn't help. :(

Still got:

Command 'CodeSync: Set VSCode executable name' resulted in an error (command 'codeSync.setCodeExecutableName' not found)
onDidChangeNotification @ workbench.desktop.main.js:152357
(anonymous) @ workbench.desktop.main.js:152345
fire @ workbench.desktop.main.js:5723
addNotification @ workbench.desktop.main.js:154368
error @ workbench.desktop.main.js:221152
accept @ workbench.desktop.main.js:142022
processTicksAndRejections @ internal/process/task_queues.js:85
async function (async)
accept @ workbench.desktop.main.js:142018
(anonymous) @ workbench.desktop.main.js:96532
fire @ workbench.desktop.main.js:5723
(anonymous) @ workbench.desktop.main.js:68168
fire @ workbench.desktop.main.js:5723
(anonymous) @ workbench.desktop.main.js:68603
golf1052 commented 4 years ago

Can you try exiting VSCode, deleting the settings.json file, and then launching VSCode again?

convexshiba commented 4 years ago

Thank you!

after delete settings and restart, it now prompts me to enter path and enter executableName

However after all is done. I saw one file in my sync folder: extensions.json

  1. Invoking other Export keybindings/settings, does not incur any error, but nor does it produce any new files under sync folder.
  2. Add installed extension exclusion works: add exclude, click Export All, the extension will disappear from extensions.json

Do I need to anything extra to make keybindings and settings work?

golf1052 commented 4 years ago

Can you paste your CodeSync logs here? They are available in the Output view (View > Output > CodeSync)

convexshiba commented 4 years ago

Oh this is helpful:

    2020-05-17T19:52:34.164Z - Exporting settings.
    2020-05-17T19:52:34.164Z - Could not find settings path at /Users/abc/Library/Application Support/Code/User/settings.json. Giving up.
    2020-05-17T19:52:34.164Z - Could not find keybindings path at /Users/abc/Library/Application Support/Code/User/keybindings.json. Giving up.
    2020-05-17T19:52:34.165Z - Could not find snippets path at /Users/abc/Library/Application Support/Code/User/snippets/. Giving up.
    2020-05-17T19:52:34.165Z - Exporting extensions
    2020-05-17T19:52:34.166Z - Finished exporting extensions

The actual path to settings is: /Users/abc/Library/Application Support/[some_other_name]/User/settings.json

For some reason it can output extensions.json maybe this is clil supported?

God this is messy. Thanks so much for helping.

golf1052 commented 4 years ago

Yes if extensions.json is being created that means the CLI path was found. Once you manually set the VSCode settings path for CodeSync whenever you try and export settings this log line should appear in the CodeSync logs.

Using user defined settings path: [whatever your path is]

convexshiba commented 4 years ago

My god what are these people thinking.

The custom path contains special characters like '/Users/abc/Library/Application Support/VS Code @ My Wonderful Company/User/` And I believe this might be causing problems:

    2020-05-17T23:02:47.487Z - Exporting settings.
helpers.ts
    2020-05-17T23:02:47.487Z - Using user defined settings path: /Users/abc/Library/Application Support/VS Code @ My Wonderful Company/User/

And then this: image

Command 'CodeSync: Export all' resulted in an error (Unexpected token })
onDidChangeNotification @ workbench.desktop.main.js:152357
(anonymous) @ workbench.desktop.main.js:152345
fire @ workbench.desktop.main.js:5723
addNotification @ workbench.desktop.main.js:154368
error @ workbench.desktop.main.js:221152
accept @ workbench.desktop.main.js:142022
processTicksAndRejections @ internal/process/task_queues.js:85
async function (async)
accept @ workbench.desktop.main.js:142018
(anonymous) @ workbench.desktop.main.js:96532
fire @ workbench.desktop.main.js:5723
(anonymous) @ workbench.desktop.main.js:68168
fire @ workbench.desktop.main.js:5723
(anonymous) @ workbench.desktop.main.js:68603

Thank you.

golf1052 commented 4 years ago

What OS are you on? I tried this in Linux and I am not getting this error.

convexshiba commented 4 years ago

@golf1052 Just regular MacOS.

I'm total noob with js but this error, is it inside the extension or is it inside the vscode's code?

golf1052 commented 4 years ago

This is a VSCode error, the problem with nailing down where this error is, is that VSCode can't output the stacktrace of extensions.

convexshiba commented 4 years ago

ah any way I can help debug this?

My settings file contains comment in the form of "// comments", not sure if this is interfering with anything.

golf1052 commented 4 years ago

If you're able to setup the extension locally you should be able to get a stack trace while debugging. That would be very helpful.

convexshiba commented 4 years ago

okey finally got to it and here's where it's complaining:


workbench.desktop.main.js:153286 Command 'CodeSync: Export all' resulted in an error (Unexpected token })

  | onDidChangeNotification | @ | workbench.desktop.main.js:153286
-- | -- | -- | --
  | (anonymous) | @ | workbench.desktop.main.js:153274
  | fire | @ | workbench.desktop.main.js:5429
  | addNotification | @ | workbench.desktop.main.js:155321
  | error | @ | workbench.desktop.main.js:224546
  | accept | @ | workbench.desktop.main.js:143039
  | processTicksAndRejections | @ | internal/process/task_queues.js:85
  | async function (async) |   |  
  | accept | @ | workbench.desktop.main.js:143035
  | (anonymous) | @ | workbench.desktop.main.js:97260
  | fire | @ | workbench.desktop.main.js:5429
  | (anonymous) | @ | workbench.desktop.main.js:68626
  | fire | @ | workbench.desktop.main.js:5429
  | (anonymous) | @ | workbench.desktop.main.js:69076