Notepad++ SU8 Ruby API Autocomplete
-
There's a few Notepad++ Autocomplete for SketchUp API Ruby - I've been using one variant (can't remember which one.)
Today I updated it to include the methods in SU8 which where missing. And I removed some redundant duplicate lines.
Another change I made was remove the extra space after method names. Two reasons for that:
- personal preference, I like to use brackets.
- it allowed me to add argument hints to methods.
The argument hints is a lot of work. I only did a couple for test. If anyone care to help out I'd be very happy.
There appear to be something not working quite right. I'm not getting all the words in the suggestion list. For instance, it won't display "Sketchup" as a suggestion - despite it being there in the list.
Fixed it!
Download Revision 2 - the two of you who downloaded Revision 1.Install
Copy toC:\Program Files (x86)\Notepad++\plugins\APIs
(Adapt to your Notepad++ installtion)
Settings > Preferences... > Backup/Auto-Completion
Revision 3 - 01.02.2011
Rebuilt the list from scratch. Used only the classes and methods from Ruby 1.8.6 and SketchUp API. (The old file seemed to have lots of Ruby On Rails references.)Moved to BitBucket - 03.02.2011
Find theruby.xml
file at the BitBucket repository:
https://bitbucket.org/thomthom/notepad-sketchup-autocomplete/Direct link to ZIP:
https://bitbucket.org/thomthom/notepad-sketchup-autocomplete/get/tip.zip -
Ohh, awesome !! I had two versions, one I guess was made by Didier Bur (if I am not mistaking) and other was only for Ruby (from npp website).
Thank you! -
Thank-you from me as well.
-
I only use Npp occasionally, but can test it out - what do i do with the file and how to I activate auto-complete?
-
@jim said:
I only use Npp occasionally, but can test it out - what do i do with the file and how to I activate auto-complete?
Added Install info in first post.
-
@thomthom said:
There appear to be something not working quite right. I'm not getting all the words in the suggestion list. For instance, it won't display "Sketchup" as a suggestion - despite it being there in the list.
Auto Completion Wiki
"The basic character set used to recognise keywords is made of letters a-z, A-Z, 0-9 digis and the underscore. You can add more characters ... by specifying he additionalWordChars parameter in the environment."So wouldn't we need a additionalWordChars=" .:" attribute in the Environment tag, to allow space, dot and colon (in Keywords) ??
EDIT: add "=" to that list.
-
Ah - good link. I was looking for a resource like that.
Why you need dot colon in keywords?
= Seem to work anyway. Space was already there.I made this definition so getters would be
"materials.current
"setters would be
"materials.current =
" -
@dan rathbun said:
@unknownuser said:
Depending on the value of the 'ignoreCase' attribute in the 'Environment' element, the XML file has to be sorted case sensitive or case insensitive (if the attribute is absent it will default to case sensitive).
Ah! Well that explains a few things!
-
@thomthom said:
Why you need dot colon in keywords?
= Seem to work anyway. Space was already there.Just wondering if it was required so that the feature can lookup things correctly.
-
@dan rathbun said:
@thomthom said:
Why you need dot colon in keywords?
= Seem to work anyway. Space was already there.Just wondering if it was required so that the feature can lookup things correctly.
More information on this link: Autocompletion, aka API, files, which says:
@unknownuser said:
additionalWordChar: character(s) that may be part of words and which are not a lower or upper case letter, a digit or the underscore. The value is a string with all these extra characters, in any order and without separators. The string is empty by default.
EDIT .. more info from that page:
@unknownuser said:Names
For both call tips and autocompletion to work, keywords must be words, ie identifiers most languages would readily accept. This means that only the 26 Latin alphabet letters in either lower or upper case (no diacritics), digits and the underscore are safe to use. Additional allowed characters will work if they are not whitespace. Autocompletion may cope with spaces or blanks, call tips won't. This is a Scintilla limitation. -
Thank you!
-
Revision 3 - 01.02.2011
Rebuilt the list from scratch. Used only the classes and methods from Ruby 1.8.6 and SketchUp API. (The old file seemed to have lots of Ruby On Rails references.) -
Do you it's possible to have whole qualified classnames and constants in the AutoComplete?
Examples:
Math::PI
File::SEPARATOR
Sketchup::Drawingelement
UI::Toolbar
etc. ??
-
I noticed in the old list certain entries did not work correctly where the module name followed the keyword in paranthesis. Notepad++ got confused and took them to be a parameter (argument) list.
-
@dan rathbun said:
I noticed in the old list certain entries did not work correctly where the module name followed the keyword in paranthesis.
@dan rathbun said:
Do you it's possible to have whole qualified classnames and constants in the AutoComplete?
Yes, it's possible. Some Ruby classes are listed like that. File for instance. (Just ripped it directly from the docs.)
Is there a list of available?(I just ripped the class names and methods from the Ruby docs and SU docs - without further processing.) So constants and nesting is missing.
-
-
@thomthom said:
@dan rathbun said:
Do you it's possible to have whole qualified classnames and constants in the AutoComplete?
Is there a list of available?
Both ver 2, and the original (Didier's version?) have fully qualified classes that you can cut and paste from.
For constants we'll have to compile a list.
-
@dan rathbun said:
@thomthom said:
@dan rathbun said:
I noticed in the old list certain entries did not work correctly where the module name followed the keyword in paranthesis.
These are the ones that caused problems (but the ver 3 does not have them.)
[attachment=0:ef22v8uz]<!-- ia0 -->old_NPP_autocomplete.png<!-- ia0 -->[/attachment:ef22v8uz]
Oh! Didn't noticed that.
@dan rathbun said:
Both ver 2, and the original (Didier's version?) have fully qualified classes that you can cut and paste from.
Ah, yea. I did that manually for v2.
-
Here's the 1.8.6 constant list for the
Errno
module, on the PC:For PC (note! OSX
SystemCallError
subclasses may differ.)<Keyword name="Errno;;E2BIG"/> <Keyword name="Errno;;E2BIG;;Errno"/> <Keyword name="Errno;;EACCES"/> <Keyword name="Errno;;EACCES;;Errno"/> <Keyword name="Errno;;EADDRINUSE"/> <Keyword name="Errno;;EADDRINUSE;;Errno"/> <Keyword name="Errno;;EADDRNOTAVAIL"/> <Keyword name="Errno;;EADDRNOTAVAIL;;Errno"/> <Keyword name="Errno;;EAFNOSUPPORT"/> <Keyword name="Errno;;EAFNOSUPPORT;;Errno"/> <Keyword name="Errno;;EAGAIN"/> <Keyword name="Errno;;EAGAIN;;Errno"/> <Keyword name="Errno;;EALREADY"/> <Keyword name="Errno;;EALREADY;;Errno"/> <Keyword name="Errno;;EBADF"/> <Keyword name="Errno;;EBADF;;Errno"/> <Keyword name="Errno;;EBUSY"/> <Keyword name="Errno;;EBUSY;;Errno"/> <Keyword name="Errno;;ECHILD"/> <Keyword name="Errno;;ECHILD;;Errno"/> <Keyword name="Errno;;ECONNABORTED"/> <Keyword name="Errno;;ECONNABORTED;;Errno"/> <Keyword name="Errno;;ECONNREFUSED"/> <Keyword name="Errno;;ECONNREFUSED;;Errno"/> <Keyword name="Errno;;ECONNRESET"/> <Keyword name="Errno;;ECONNRESET;;Errno"/> <Keyword name="Errno;;EDEADLK"/> <Keyword name="Errno;;EDEADLK;;Errno"/> <Keyword name="Errno;;EDEADLOCK"/> <Keyword name="Errno;;EDEADLOCK;;Errno"/> <Keyword name="Errno;;EDESTADDRREQ"/> <Keyword name="Errno;;EDESTADDRREQ;;Errno"/> <Keyword name="Errno;;EDOM"/> <Keyword name="Errno;;EDOM;;Errno"/> <Keyword name="Errno;;EDQUOT"/> <Keyword name="Errno;;EDQUOT;;Errno"/> <Keyword name="Errno;;EEXIST"/> <Keyword name="Errno;;EEXIST;;Errno"/> <Keyword name="Errno;;EFAULT"/> <Keyword name="Errno;;EFAULT;;Errno"/> <Keyword name="Errno;;EFBIG"/> <Keyword name="Errno;;EFBIG;;Errno"/> <Keyword name="Errno;;EHOSTDOWN"/> <Keyword name="Errno;;EHOSTDOWN;;Errno"/> <Keyword name="Errno;;EHOSTUNREACH"/> <Keyword name="Errno;;EHOSTUNREACH;;Errno"/> <Keyword name="Errno;;EILSEQ"/> <Keyword name="Errno;;EILSEQ;;Errno"/> <Keyword name="Errno;;EINPROGRESS"/> <Keyword name="Errno;;EINPROGRESS;;Errno"/> <Keyword name="Errno;;EINTR"/> <Keyword name="Errno;;EINTR;;Errno"/> <Keyword name="Errno;;EINVAL"/> <Keyword name="Errno;;EINVAL;;Errno"/> <Keyword name="Errno;;EIO"/> <Keyword name="Errno;;EIO;;Errno"/> <Keyword name="Errno;;EISCONN"/> <Keyword name="Errno;;EISCONN;;Errno"/> <Keyword name="Errno;;EISDIR"/> <Keyword name="Errno;;EISDIR;;Errno"/> <Keyword name="Errno;;ELOOP"/> <Keyword name="Errno;;ELOOP;;Errno"/> <Keyword name="Errno;;EMFILE"/> <Keyword name="Errno;;EMFILE;;Errno"/> <Keyword name="Errno;;EMLINK"/> <Keyword name="Errno;;EMLINK;;Errno"/> <Keyword name="Errno;;EMSGSIZE"/> <Keyword name="Errno;;EMSGSIZE;;Errno"/> <Keyword name="Errno;;ENAMETOOLONG"/> <Keyword name="Errno;;ENAMETOOLONG;;Errno"/> <Keyword name="Errno;;ENETDOWN"/> <Keyword name="Errno;;ENETDOWN;;Errno"/> <Keyword name="Errno;;ENETRESET"/> <Keyword name="Errno;;ENETRESET;;Errno"/> <Keyword name="Errno;;ENETUNREACH"/> <Keyword name="Errno;;ENETUNREACH;;Errno"/> <Keyword name="Errno;;ENFILE"/> <Keyword name="Errno;;ENFILE;;Errno"/> <Keyword name="Errno;;ENOBUFS"/> <Keyword name="Errno;;ENOBUFS;;Errno"/> <Keyword name="Errno;;ENODEV"/> <Keyword name="Errno;;ENODEV;;Errno"/> <Keyword name="Errno;;ENOENT"/> <Keyword name="Errno;;ENOENT;;Errno"/> <Keyword name="Errno;;ENOEXEC"/> <Keyword name="Errno;;ENOEXEC;;Errno"/> <Keyword name="Errno;;ENOLCK"/> <Keyword name="Errno;;ENOLCK;;Errno"/> <Keyword name="Errno;;ENOMEM"/> <Keyword name="Errno;;ENOMEM;;Errno"/> <Keyword name="Errno;;ENOPROTOOPT"/> <Keyword name="Errno;;ENOPROTOOPT;;Errno"/> <Keyword name="Errno;;ENOSPC"/> <Keyword name="Errno;;ENOSPC;;Errno"/> <Keyword name="Errno;;ENOSYS"/> <Keyword name="Errno;;ENOSYS;;Errno"/> <Keyword name="Errno;;ENOTCONN"/> <Keyword name="Errno;;ENOTCONN;;Errno"/> <Keyword name="Errno;;ENOTDIR"/> <Keyword name="Errno;;ENOTDIR;;Errno"/> <Keyword name="Errno;;ENOTEMPTY"/> <Keyword name="Errno;;ENOTEMPTY;;Errno"/> <Keyword name="Errno;;ENOTSOCK"/> <Keyword name="Errno;;ENOTSOCK;;Errno"/> <Keyword name="Errno;;ENOTTY"/> <Keyword name="Errno;;ENOTTY;;Errno"/> <Keyword name="Errno;;ENXIO"/> <Keyword name="Errno;;ENXIO;;Errno"/> <Keyword name="Errno;;EOPNOTSUPP"/> <Keyword name="Errno;;EOPNOTSUPP;;Errno"/> <Keyword name="Errno;;EPERM"/> <Keyword name="Errno;;EPERM;;Errno"/> <Keyword name="Errno;;EPFNOSUPPORT"/> <Keyword name="Errno;;EPFNOSUPPORT;;Errno"/> <Keyword name="Errno;;EPIPE"/> <Keyword name="Errno;;EPIPE;;Errno"/> <Keyword name="Errno;;EPROTONOSUPPORT"/> <Keyword name="Errno;;EPROTONOSUPPORT;;Errno"/> <Keyword name="Errno;;EPROTOTYPE"/> <Keyword name="Errno;;EPROTOTYPE;;Errno"/> <Keyword name="Errno;;ERANGE"/> <Keyword name="Errno;;ERANGE;;Errno"/> <Keyword name="Errno;;EREMOTE"/> <Keyword name="Errno;;EREMOTE;;Errno"/> <Keyword name="Errno;;EROFS"/> <Keyword name="Errno;;EROFS;;Errno"/> <Keyword name="Errno;;ESHUTDOWN"/> <Keyword name="Errno;;ESHUTDOWN;;Errno"/> <Keyword name="Errno;;ESOCKTNOSUPPORT"/> <Keyword name="Errno;;ESOCKTNOSUPPORT;;Errno"/> <Keyword name="Errno;;ESPIPE"/> <Keyword name="Errno;;ESPIPE;;Errno"/> <Keyword name="Errno;;ESRCH"/> <Keyword name="Errno;;ESRCH;;Errno"/> <Keyword name="Errno;;ESTALE"/> <Keyword name="Errno;;ESTALE;;Errno"/> <Keyword name="Errno;;ETIMEDOUT"/> <Keyword name="Errno;;ETIMEDOUT;;Errno"/> <Keyword name="Errno;;ETOOMANYREFS"/> <Keyword name="Errno;;ETOOMANYREFS;;Errno"/> <Keyword name="Errno;;EUSERS"/> <Keyword name="Errno;;EUSERS;;Errno"/> <Keyword name="Errno;;EWOULDBLOCK"/> <Keyword name="Errno;;EWOULDBLOCK;;Errno"/> <Keyword name="Errno;;EXDEV"/> <Keyword name="Errno;;EXDEV;;Errno"/>
output via: Ruby console and type (one-liner):
Errno.constants.sort.each {|e| puts %Q[\t\t<Keyword name="Errno::#{e}"/>\n\t\t<Keyword name="Errno::#{e}::Errno"/>\n] }
Then copy and paste into the ruby.xml file for Notepad++ -
Here's the 1.8.6 constant list for the
File
module:<KeyWord name="File;;ALT_SEPARATOR"/> <KeyWord name="File;;APPEND"/> <KeyWord name="File;;BINARY"/> <KeyWord name="File;;CREAT"/> <KeyWord name="File;;Constants;;APPEND"/> <KeyWord name="File;;Constants;;BINARY"/> <KeyWord name="File;;Constants;;CREAT"/> <KeyWord name="File;;Constants;;EXCL"/> <KeyWord name="File;;Constants;;FNM_CASEFOLD"/> <KeyWord name="File;;Constants;;FNM_DOTMATCH"/> <KeyWord name="File;;Constants;;FNM_NOESCAPE"/> <KeyWord name="File;;Constants;;FNM_PATHNAME"/> <KeyWord name="File;;Constants;;FNM_SYSCASE"/> <KeyWord name="File;;Constants;;LOCK_EX"/> <KeyWord name="File;;Constants;;LOCK_NB"/> <KeyWord name="File;;Constants;;LOCK_SH"/> <KeyWord name="File;;Constants;;LOCK_UN"/> <KeyWord name="File;;Constants;;NONBLOCK"/> <KeyWord name="File;;Constants;;RDONLY"/> <KeyWord name="File;;Constants;;RDWR"/> <KeyWord name="File;;Constants;;TRUNC"/> <KeyWord name="File;;Constants;;WRONLY"/> <KeyWord name="File;;EXCL"/> <KeyWord name="File;;FNM_CASEFOLD"/> <KeyWord name="File;;FNM_DOTMATCH"/> <KeyWord name="File;;FNM_NOESCAPE"/> <KeyWord name="File;;FNM_PATHNAME"/> <KeyWord name="File;;FNM_SYSCASE"/> <KeyWord name="File;;LOCK_EX"/> <KeyWord name="File;;LOCK_NB"/> <KeyWord name="File;;LOCK_SH"/> <KeyWord name="File;;LOCK_UN"/> <KeyWord name="File;;NONBLOCK"/> <KeyWord name="File;;PATH_SEPARATOR"/> <KeyWord name="File;;RDONLY"/> <KeyWord name="File;;RDWR"/> <KeyWord name="File;;SEEK_CUR"/> <KeyWord name="File;;SEEK_END"/> <KeyWord name="File;;SEEK_SET"/> <KeyWord name="File;;SEPARATOR"/> <KeyWord name="File;;Separator"/> <KeyWord name="File;;TRUNC"/> <KeyWord name="File;;WRONLY"/>
Advertisement