SketchUcation Plugin Store

 

 

Notepad++ SU8 Ruby API Autocomplete

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Dan Rathbun » Thu Feb 03, 2011 6:04 pm

driven wrote:here it is, ...

Looks like there are 85 of them on the Mac (thanks John.)

driven wrote: ...I'm running these through Ruby Console, so aren't they shielded from external globals?

HELL NO. The Ruby Console runs WITHIN Object, anything you define there becomes global. That's why it's dangerous to define methods in the console.. they get inherited by ALL objects.
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4076
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Dan Rathbun » Thu Feb 03, 2011 6:05 pm

BUT if running one of the WebConsoles ... you might be within the coder's namespace instead of Object.
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4076
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Dan Rathbun » Thu Feb 03, 2011 6:30 pm

driven wrote:Is the a 1.8.6 module that simply didn't exist at all in 1.8.5 that I could test for?

Well I'm purty sure module DanZoid did not exist in Ruby 1.8.5... or any version. (snicker) :P

Offhand I dont know of one such module (mostly the changes have been adding or removing methods and constants, and fixing bugs.)

I don't really have a good 1.8.5 reference... just all those numerous YAML documents in share\ri\1.8\system and I don't have time to learn how to use rdoc to generate a HTML help page right now.

If you want to know what happens when a non-existant module (or class,) is referenced in Ruby, the answer is that a NameError exception is raised.

Try it at the console...
puts DrivenUpTheWall.methods
~
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4076
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby driven » Thu Feb 03, 2011 7:47 pm

Dan Rathbun wrote:Here's the 1.8.6 constant list AND class methods for the Marshal module:

As an experiment, in parameters, I used:
"~" to denote "this class or subclass"
"^" to denote "implictly convertable to" (which would include the class and any subclasses.)

for ex: ^Integer would mean: "Integer class, subclass, or object that implements a to_i() method."


Hi Dan,
What I was trying to say is I don't know the method you used to get the additional information about this Constant.
I tried a couple of things to add it to the other code snippet, but I have had no luck (which is what's required for me).

I realise if a method doesn't exist it throws an error, so what I'm looking for is a method that didn't exist in 1.8.5 (which SkechUp says its using on Macs), if this newer Ruby/Class/Constant, etc.., is present then SU must be referencing or have access to other installed versions.

There's a native coca utility http://chmox.sourceforge.net/ for reading CHM on OSX, forgot I had, so now I'll have a look.

The other thing I'm always looking for is what makes WebDialog different on the Mac, so probing SU through the ruby console appeals to me.

Not to mention that autocomplete on a Mac editor would be a good thing...

john

john
driven
Top SketchUcator
 
Posts: 1409
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Thu Feb 03, 2011 8:08 pm

driven wrote:Not to mention that autocomplete on a Mac editor would be a good thing...

I use TextMate, would be nice to get an autocomplete for that. If that's even possible...
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Dan Rathbun » Thu Feb 03, 2011 8:41 pm

driven wrote:
Dan Rathbun wrote:Here's the 1.8.6 constant list AND class methods for the Marshal module:

What I was trying to say is I don't know the method you used to get the additional information about this Constant.

If you mean the text that is in the XML descr attributes.. that I just copy and pasted manually out of the Ruby Core Reference Help CHM. Then edited it a bit to make it more readable, more concise, etc. (Sometimes those Japanese guys who work on the Ruby Core don't write the best English.)

Of course... doing that manually for all of the methods in Ruby and the Sketchup API is a lifetime project.

I'm looking at seeing if I can script it.. at least grabbing the text that can be edited and cut-down later. (Notepad++ has a memory limit to the text for each function.)

@@ThomThom - That BitBucket website just about locks up MSIE 7. But I stopped posting new constant lists, as I realized that it is better the write a plugin that generates the XML files, so I've been working on that. Also need to write a database utility, or maybe a webform so the functions and overloads can be added, edited, etc. more easily by multiple people.
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4076
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby driven » Thu Feb 03, 2011 9:08 pm

thomthom wrote:I use TextMate, would be nice to get an autocomplete for that. If that's even possible...

I'll try this with TextWrangler, and let you know how it pans out http://c-command.com/bbautocomplete/

john
driven
Top SketchUcator
 
Posts: 1409
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Thu Feb 03, 2011 9:13 pm

Dan Rathbun wrote:@@ThomThom - That BitBucket website just about locks up MSIE 7

hm... No problems in IE8 here. (Don't have IE7 any more on any of my machines.)
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby unclex » Wed Feb 09, 2011 4:28 am

Wonderful!!!!!!
unclex
 
Posts: 56
Joined: Fri Sep 18, 2009 12:28 pm

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Jim » Sat Jun 02, 2012 9:56 pm

This seems sort on hard to maintain as a .xml file. Would it be easier to manage as in a different format that could be translated into the .xml?

Maybe a spreadsheet?
(A read-only version of the actual Spreadsheet)

Edit - see next post.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Jim » Sun Jun 03, 2012 4:52 pm

Here's a Ruby script that creates the Ruby.xml auto-complete file directly from the online spreadsheet.

Use:
prompt$ ruby gss2nppxml.rb (Google Spreadsheet 2 Notepad Plus Plus XML)

requires 'nokogiri' (gem install nokogiri)

The file Ruby.xml will be created in the same folder. Move/Copy this file to the Notepad++ plugins/API folder and restart Notepad++.

n++ auto-complete documentation.

The spreadsheet is publically editable by anyone with the link (see attachment,) so anyone can easily contribute by adding return values and function paramter hints to the sheets.
Please, register (free) to access all the attachments on the forums.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Sun Jun 03, 2012 9:43 pm

Oooh, what have you done here Jim? Looks interesting. I haven't checked out the spreadcheet you generated, but does it include argument name hints?
Do you have a pre-compiled XML file?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Dan Rathbun » Sun Jun 03, 2012 9:55 pm

So the spreadsheet is is used as a dB. I had done this in the past when outputting HTML API docs for eigenMath, which I eventually compiled into a CHM using the free MS HTML Help Workshop.

I had proposed something along this line for the Ruby API docs, but input forms would be a great benefit. Fortunately.. Excel and it's OpenSource clones can have worksheets that are dB input forms (or the suite's dB engine Access or OpenBase, can be used to create an updating applet with forms.)
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4076
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Jim » Sun Jun 03, 2012 10:18 pm

thomthom wrote:does it include argument name hints?


Yes. If you look at the spreadsheet, overloads are handled using a period (.) You can have any number of overloads and parameters.

thomthom wrote:Do you have a pre-compiled XML file?


Ruby.xml.txt


NP++ Seems to get confused, though. See how NP++ uses the hints from add for add_3d_text. I can't see anything wrong in the XML according to the docs.

2012-06-03_171410.png


2012-06-03_171428.png
Please, register (free) to access all the attachments on the forums.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Anton_S » Mon Jun 04, 2012 6:25 am

Is there a way for np++ automatically to add/remove your own module, class, and method names into/from the auto-complition list?

What I mean:
Lets say I write some class in NP++, naming it 'Anton'.
On the next line I start with letter A and the auto-completion-list should show-up displaying all index with A including my name.
Then I erase my class and on next line start with word A again. Now, the index list should no longer have 'Anton' in the index.

Sorry, that's kind of awkward put together, though I hope ya could understand what I mean. :knockout:
Anton_S
 
Posts: 208
Joined: Tue Nov 23, 2010 9:15 pm
Location: Salem Oregon US
Name: AntonSynytsia
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: hobby
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Mon Jun 04, 2012 8:41 am

Not that I'm aware of - but it would be really nice. It's something that an IDE does though - and Notepadd++ is more of a text editor than an IDE. But they do have a plugin system - maybe there is something there.... ?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Dan Rathbun » Mon Jun 04, 2012 10:49 am

Anton_S wrote:Is there a way for np++ automatically to add/remove your own module, class, and method names into/from the auto-complition list?

What I was really wishing for... was to be able to load multiple API overlay files.

One for Core Ruby. Then if You wanted to work on a Rails project, you could load a Rails API overlay list.

For a Sketchup example, the Core Ruby API would always load. Then of course we'd need the basic Sketchup API. If we also needed the TT_Lib API, and the WxSU APIs, we could load them also.

NP++ has session files that keep track of all open files in a project, their window sizes, the language they use, where the cursor is, what is hilighted, etc. So keeping an API file list for each file would not be "out of this world."

For a Js example, you could set a Core Js, and overlay say, the JQuery API on top of it.

And it would also be nice to have a "bread-crumb" API bar that would list the loaded APIs for the active file.
There is alot of room on the left side of the statusbar (just after it displays the file language, and before the file length.)

:idea:
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4076
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Mon Jun 04, 2012 11:14 am

Off-Topic:
And a list of methods in file...
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Jim » Tue Jun 05, 2012 12:32 am

Time to find a new editor.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Tue Jun 05, 2012 9:47 am

Jim wrote:Time to find a new editor.

Got any good alternatives?

On OSX there is TextMate, but Windows...?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Rich O Brien » Tue Jun 05, 2012 10:47 am

Sublime 2?
:::Blog:::

I'm a Trimbler now!
User avatar
Rich O Brien
Administrator
 
Posts: 8298
Joined: Fri Oct 31, 2008 9:05 am
Location: Limerick, Ireland
Name: Rich O'Brien
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Tue Jun 05, 2012 11:10 am

Rich O Brien wrote:Sublime 2?

Looking really good!! So far it got the features I use the most in NP++. :thumb: :thumb: :thumb:
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Tue Jun 05, 2012 11:13 am

Ah! Yes! Code insight! It suggest the methods I have in the current document! sweeeet!

Didn't provide hint for File.exist? - it suggested File, but not exist? ...

You can add your own keywords? Anyone added the SU API to this?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Rich O Brien » Tue Jun 05, 2012 11:14 am

found it a few months back and really like it but i don't use it for ruby
:::Blog:::

I'm a Trimbler now!
User avatar
Rich O Brien
Administrator
 
Posts: 8298
Joined: Fri Oct 31, 2008 9:05 am
Location: Limerick, Ireland
Name: Rich O'Brien
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Tue Jun 05, 2012 11:16 am

And spell checking for comments and strings!!! FTW!!!

Default shortcuts for bookmarks and duplicate line is the same as NP++ ... double-plus-good!!!

Now, where is current-line-highlighting...?
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Anton_S » Wed Jun 06, 2012 12:04 am

Rich O Brien wrote:Sublime 2?

Sublime 2 is awesome!!!
Anton_S
 
Posts: 208
Joined: Tue Nov 23, 2010 9:15 pm
Location: Salem Oregon US
Name: AntonSynytsia
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: hobby
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby thomthom » Wed Jun 06, 2012 8:54 am

Anton_S wrote:
Rich O Brien wrote:Sublime 2?

Sublime 2 is awesome!!!

Ditto! It's not freeware - but I have no problem paying for this one.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17634
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Dan Rathbun » Wed Jun 06, 2012 10:47 am

Wasn't there an old thread where we discussed various editors Komodo, etc. ?
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4076
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: Notepad++ SU8 Ruby API Autocomplete

Postby Anton_S » Sat Jun 09, 2012 11:50 pm

thomthom wrote:
Anton_S wrote:
Rich O Brien wrote:Sublime 2?

Sublime 2 is awesome!!!

Ditto! It's not freeware - but I have no problem paying for this one.


Sure, piece of cake :D

'Hay, dad...'
Anton_S
 
Posts: 208
Joined: Tue Nov 23, 2010 9:15 pm
Location: Salem Oregon US
Name: AntonSynytsia
Operating system: Windows
SketchUp version: 8
License type: Free
SketchUp use: hobby
Level of SketchUp: Intermediate

Re: Notepad++ SU8 Ruby API Autocomplete

Postby njeremy2 » Wed Jun 13, 2012 7:47 am

WOW ! I just try it right now and it's impressive work !
It's little bit easier to write a code now ! :thumb:
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Artisan Organic Toolset - a set of powerful organic modeling tools.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012

PreviousNext

Return to Developers' Forum

Who is online

Users browsing this forum: jiminy-billy-bob, raul9867, swarfer, Trogluddite and 9 guests