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

VSCode tasks.json - & was unexpected at this time #18

Open
asouth opened this issue Jul 7, 2018 · 14 comments
Open

VSCode tasks.json - & was unexpected at this time #18

asouth opened this issue Jul 7, 2018 · 14 comments
Labels

Comments

@asouth
Copy link

asouth commented Jul 7, 2018

Hi,

There maybe a simple fix for this but as far as I can tell I followed the instructions here for setting the VSCode environment up for debugging ruby extensions for Sketchup 2016 to the letter.

However with Sketchup closed, when I choose [Tasks -> Run Tasks -> Debug Sketchup 2016] I get the following message in the Terminal:

Executing task: &'C:/Program Files/SketchUp/SketchUp 2016/SketchUp.exe' -rdebug 'ide port=7000' <

& was unexpected at this time.
The terminal process terminated with exit code: 1

It seems to be complaining about the & in front of the filepath, but if i remove it just complains about the C:

Can anyone assist with this?

I'm running Sketchup 2016 Pro Version 16.0.19912 64 bit | Windows 7 64bit

Thanks
Alex

@asouth
Copy link
Author

asouth commented Jul 7, 2018

I just realised the instructions say 2014 Maintenance Version or Later. I'm running 2016 Pro could this be this issue?

@BugraBarin
Copy link
Member

This should work in 2016 in theory but I don't have an installation handy to verify. It works on my setup with the following tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Debug SketchUp 2018",
      "type": "shell",
      "windows": {
        "command": "&'C:/Program Files/SketchUp/SketchUp 2018/SketchUp.exe' -rdebug 'ide port=7000'"
      },
      "problemMatcher": []
    }
  ]
}

@thomthom
Copy link
Member

thomthom commented Jul 9, 2018

What terminal type is your VSCode set up to use? cmd or PowerShell?

@thomthom
Copy link
Member

thomthom commented Jul 9, 2018

I see you have Windows 7, so you're probably using cmd if you are using default setup.

In Win10 Powershell is default. I think & was for that. You said that removing the & also didn't work, but what is the full error message?

@asouth
Copy link
Author

asouth commented Jul 9, 2018

Thanks for the responses.
Yes i'm using the standard installation on Windows 7 64 bit.

@thomthom Removing the & produced the following error message:
''C:' is not recognized as an internal or external command, operable program or batch file.

@BugraBarin I tried the following code based on what you posted for SU 2018 but i get the same error message about the &

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Debug SketchUp 2016",
      "type": "shell",
      "windows": {
        "command": "&'C:/Program Files/SketchUp/SketchUp 2016/SketchUp.exe' -rdebug 'ide port=7000'"
      },
      "problemMatcher": []
    }
  ]
}

I'll look up on how/if i can switch to PowerShell command line in VSCode and report back.

@asouth
Copy link
Author

asouth commented Jul 9, 2018

Ok, I had partial success I think.

In VSCode, I navigated to File > Preferences > Settings and added the following lines to the User Setting on the right pane as follows:

// Use PowerShell if available "terminal.integrated.shell.windows":"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"

Note that this is only for a Windows 7 installation as I believe Powershell is located in C:\Windows\sysnative\ and not System32 on Windows 10.

Next with Sketchup closed, when I choose [Tasks -> Run Tasks -> Debug Sketchup 2016], Sketchup now starts up as expected, but then it seems to hang. This behavior might be expected; perhaps it's waiting for me to do something in VSCode?

@asouth
Copy link
Author

asouth commented Jul 9, 2018

Another update.

The Sketchup hang was simply because it was waiting for me to start the debugger in VSCode once SU and plugin was launched, although I can't see a way to add a Watch or inspect a Variable!!! I guess this is my issue though! Thanks for the nudges in the right direction.

@BugraBarin
Copy link
Member

Did you grab the latest version of the DLL? We recently modified it so that SU shouldn't hang at startup by default. There is now a 'wait' command line parameter to get it to wait (check out the readme).

Anyway, glad to hear that you got over the initial problem.

@thomthom
Copy link
Member

Maybe you need to alter 'C:/Program Files/SketchUp/SketchUp 2016/SketchUp.exe' to use Windows slashes instead of forward slashes to get cmd to work?

@asouth
Copy link
Author

asouth commented Jul 18, 2018

Hi

Before i close this issue - where is the best place to get help using the extension debugger in VS Code?

I'm having issues with not being able to view the value of a variable in the locals and watch windows when stepping (F10). In addition, the stepping doesn't always work. Is there a script i can test to check the vs code is setup properly?

@thomthom
Copy link
Member

You mean with the VS Code extension in general? Or in conjunction with SketchUp?

@asouth
Copy link
Author

asouth commented Jul 19, 2018

I mean in conjunction with sketchup, although I must admit I’ve not used vscode before only visual studio pro.

@thomthom
Copy link
Member

If it might be a bug with the SketchUp debugger then can you open a new issue with a minimal sample to reproduce?

@JianboBai
Copy link

Ok, I had partial success I think.

In VSCode, I navigated to File > Preferences > Settings and added the following lines to the User Setting on the right pane as follows:

// Use PowerShell if available "terminal.integrated.shell.windows":"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"

Note that this is only for a Windows 7 installation as I believe Powershell is located in C:\Windows\sysnative\ and not System32 on Windows 10.

Next with Sketchup closed, when I choose [Tasks -> Run Tasks -> Debug Sketchup 2016], Sketchup now starts up as expected, but then it seems to hang. This behavior might be expected; perhaps it's waiting for me to do something in VSCode?

I don't find the rightway to add the setting. The version of my VSCode is 1.38.

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

No branches or pull requests

4 participants