VSCode debugger attaches, but breakpoints are ignored

It does work on a more conventional path. Of course, that doesn’t prove the problem was the junction, only that one path works and the other doesn’t. I will investigate further and report when I have something definitive.

Part of my problem now is that the plug-in doc is a bit vague. I think I have all the necessary stuff, but the behavior I’m getting is hard for me to understand. For example, auto-complete in the editor seems inconsistent/incomplete. And I have no idea how the “require” modules are being found. It appears to have something to do with “gems,” which I also don’t really understand as of yet.

Also, can someone tell me what a “language server” is? Really, it has been a very long time since I have felt this confused by a software tool. The documentation and tutorials available for things like Visual Studio (and SketchUp!) include some very thorough, very professional material. For VS Code, I’m feeling like I’ve arrived at the party late and, although there is a very lively conversation already going on, no one will tell me what the actual topic is.

AutoComplete for the SketchUp API requires the use of stubs (for any IDE since the API is defined within the executable.)

Ruby gems are an archive package extension of code. Usually these install into a local “system” Ruby installation.

Thomas explains it’s use in Create a gem with the stubs · Issue #21 · SketchUp/ruby-api-stubs · GitHub
It seems it makes things easier for RubyMine as it loads Ruby itself.

I do not know if the gem helps with VSCode. I manually copied the lib folder of the stubs repo into the Ruby lib of the system Ruby install that I specified in the Ruby settings for VSCode.
But AutoComplete or IntelliSense does not seem to work. Only the suggestions from object names that exist already in the code file are suggested.

Can split up the issues into separate questions? I’ll see what I can do to help and further improve documentation.

Using the VSCode example project?
(Key part with that is to use Bundler to install the required gems for the development tools)

NO. I just tried to “hack it” by copying the stubs into the system Ruby 2.5 lib folder.
And I hadn’t installed the Bundler gem into this or any other Ruby install. (I’ve at least 3 Ruby versions installed.)


This is the specific part that needs to be done to get the autocomplete working correctly.

From the command line you need to install a couple of gems to your standalone installation of Ruby:

gem install yard
gem install solargraph
gem install sketchup-api-stubs
yard gems sketchup-api-stubs

Ah, so I missed the fact that the IDE names (in the table) are links to specific setup tutorials.

@thomthom perhaps add a note to the IDE column of the debugger README to tell readers to click the IDE name-links for specific ide setup instructions.

1 Like

This is where I find the VSCode project to be easiest to promote as a setup, because it will recommend the VSCode extensions to install upon opening the project. And then it’s mostly a matter doing a bundle install to ensure you got the gems that provide code insight etc.

Will do - it’s good to get feedback on how people are discovering (or not discovering these resources).