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

Code was not found on your path #41

Open
convexshiba opened this issue Apr 18, 2020 · 20 comments
Open

Code was not found on your path #41

convexshiba opened this issue Apr 18, 2020 · 20 comments

Comments

@convexshiba
Copy link

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
Copy link
Owner

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

@convexshiba
Copy link
Author

convexshiba commented Apr 19, 2020

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
Copy link
Author

Hi, sorry to chase on this.

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

golf1052 added a commit that referenced this issue May 10, 2020
@golf1052
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@golf1052
Copy link
Owner

2.7.1 is now released. try that.

@convexshiba
Copy link
Author

convexshiba commented May 10, 2020

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
Copy link
Owner

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

@convexshiba
Copy link
Author

convexshiba commented May 11, 2020

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
Copy link
Owner

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

@convexshiba
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

convexshiba commented May 17, 2020

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
Copy link
Owner

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

@convexshiba
Copy link
Author

@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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

convexshiba commented Jun 20, 2020

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


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

No branches or pull requests

2 participants