Setting configuration IDE RubyMine for SketchUp API


#1

I am wondering how to properly setting configuration the intellisense support in IDE RubyMine for SketchUp Rury API.

Thank you


#2
  1. Added the path to ruby.exe interpreter

  2. Added the load path for the directory “Tools”

IntelliSense works, but not all types of data. For example, the method “messagebox” is not displayed for “UI Classes”. If run the plugin, everything works. For standard Ruby class methods Intellisense works.

Any ideas are welcome.
Thank you


#3

What I did was use Jim’s API docs GitHub project as stubs to give RubyMine insight to the SketchUp API:

Notice that I added it as a sub-module in git - so I can easily pull updates.

Because the API doc git repo is in the project folder configured for my project RubyMine picks it up and makes use of it.

Not perfect, but does 95% of the job.
The GitHub repo is still missing details on a few classes, but it’s being updated rather frequently. It’s a rather new project.


#4

Well, I see that the library is connected, although strangely that is exactly the case. But there is a parsing error IDE

Probably IDE RubyMine has some features…)


#5

At the time of downloading the plugin in SketchUp, I get an error that the file ui. rb was not found. It turns out that need to remove string the (require ‘lib/ui.rb’) from code.

I understand that can write a plugin in notepad, but then why use an IDE?


#6

That’s because the stubs are missing the arguments to UI.messagebox. As I mentioned, the repository isn’t complete at this moment. The ideal thing would be to correct these things when you run into them and send the changes back up stream to the repo.


#7

Well, how about this?

Each time a delete string (require ’ lib/ui.rb ') from the code?


#8

Oh wait, what? are you loading the stub files with require?
I’m a bit confused to what is going on now.

You only need to have the stub files from the repo set up so RubyMine can find them - you don’t need to require them in your code.


#9

I get an error executing the plugin if the code contains a string a require 'lib/ui.rb'
If remove the string require 'lib/ui.rb' then there is no problem. If make a copy of the file ui.rb in directory plugin resource, in this case, to avoid errors.

As far as I understand, in the directory (C:\Program Files\SketchUp\SketchUp 2015\Tools) does not contain the file ui.rb default. Perhaps the interpreter has determined string require 'lib/ui.rb' as an error.


#10

You are not supposed to actually be using or requiring the files in https://github.com/jimfoltz/SketchUp-Ruby-API-Doc
Just have the files configured somewhere in your RubyMine project so it can find it. They a simply stubs.


#11

I understand, but I see no reason to use this library. I think that need to create other tools to support IntelliSense.


#12

Well, I suggested it as a quick way to give RubyMine some insight to the Ruby API - one that works right now.
When I contacted RubyMine support the response I got was that to create stubs - just like what this repo does.


#13

Thanks for the support


#14

I have put the SketchUp-Ruby-API-Doc into my project folder, but it seems that Rubymine doesnt’t parse that directory and the auto completion doesn’t work. Would you please tell me how to configure that RubyMine project can find it?


#15

Here’s how I typically set up a project:


#16

I once create a symbolic link (or copy) of the SketchUp-Ruby-API-Doc/lib folder into the RubyMine/rubystubs… folder and all future projects will have access to the symbols without including extra files in the project.


#17

Hi Aerilius: I am using SKETCHUP 2017. I can execute under Windows 10, Rubymine 2016.3.1, and get to SETTINGS. I select external libraries in bottom of left panel. From there can you tell me what steps to get Sketchup 2017 Ruby API to work? I can select RUBY SDK and GEMS, select RUBYMINE? How do you get your “external libraries” as shown above?
Thank you in advance. Rubymine looks great, sketchup API needs an API. There should be a .bat file or automatic loader as part of Sketchup to load it. And you are truly a Sketchup Maestro


#18

Hi @sannerwind, have you looked at these guides we recently created?


#19

Hi TT:_SU. 1: Thank you, very helpful. SU is an outstanding system, and this tutorial is helpful. Is there a program which installs RubyMine for SU-2017, with user inputs? Or a video with major pauses after each navigation step; w subtitles showing all the navigation steps. Perhaps a help file listing the navigation to get to the screens as you’ve done for “file>settings>Project Structure”? In brief, getting up to HIGH speed, in a few prepackaged sessions, is the Rubicon to cross, so SU work environment(s) can generate end products of professional quality, deftly, via the API, and/ or screen menus. 2: Any tricks or watch-its to set up a non-SU Rubymine-Ruby IDE, that does conflict with a SU-Rubymine IDE? The Non-SU IDE running on a different Ruby or Ruby On Rails translator/ Engine. Lots of Ruby Resources that could be cobbled into an SU project, via an executable thread, etc.


#20

You use your file manager (“Explorer”) and go to the folder whereever you installed RubyMine (for example C:/Program Files (x86)/JetBrains/RubyMine 132.104/). There you find “rubystubs” folders (for each installed ruby version). This is where RubyMine automatically searches for stubs and symbols.

If you copy (or link) the SketchUp-Ruby-API-Doc/lib folder into the stubs folder, RubyMine will load these symbols, too.