[Feature Request] Code Editor: ComboBox for methods

Dear @support,

would it be possible to add an ComboBox e.g. at the title bar of the code editor where all the methods in my code are listed?

By selecting a method name the code editor should jump to the right place in the code.

1 Like

While your feature request still stands, I thought I'd mention other possibilities in case you weren't aware. Some people edit code in an external editor of their choice, then copy/paste it back into Hubitat to test. (Some people also have an automated way of "pushing" this code there, but that's a bit too much for me--but you can find a couple things here, I know.) Visual Studio Code seems to be a popular choice, and there is a Groovy plugin that works well for syntax highlighting--and, similar to what you want, creating a code "outline" from method names and whatnot that allows jumping to that specific section when clicked. In my experience, this works well if you use def for just about everything but becomes a bit awkward when you start specifically typing...but it still works. Maybe there are multiple plug-ins and I'm using the "wrong" one. :slight_smile:

I know, not really what you're asking for. But the code editors have barely been touched since they were introduced (I think importUrl for drivers and "remembering" the last URL for apps were the only changes since their introduction?), so I wouldn't hold my breath on much else.

2 Likes

I use Sublime text. I have both the Hubitat editor open and Sublime open. I make changes in Sublime Editor and simply copy from sublime and paste in Hubitat.
I also but my code revisions added on to the code name.

Looks interesting. How does it handle plain text or other text files?

Thanx for all the suggestions! But...

I'm already using Eclipse for Groovy programming. :wink:

I need the feature for three reasons, where an external IDE cannot help:
a) Make small edits in the Hubitat code editor (e.g. try variants).
b) Debug code when an warning in my logs occurs.
c) Testing purposes.

Glad you have something that otherwise works for you! I personally wouldn't count on this happening any time soon, but I've been wrong before. :slight_smile: (Again, I don't recall anything having been added except the minor additions I mentinoed above, and nearly all of their focus lately has been on user-facing features like drivers and new/improved apps, etc.--and we've been told that they basically use the same tools for these and find them adequate.)

Something that may help you in the meantime if you don't feel like using an external editor and haven't already discovered this: the "Find" feature (Ctrl+F or Cmd+F) should hook into the editor and use its built-in search instead of your browser's, and that is often something I'll use to find a method. This is very easy if you know the type (or lack thereof): you can search for void myFunction( or String<List> setLevel(, for example, and that's usually the only thing it will find and take you right there. For the other things listed, they're certainly possible in the existing editor, though I understand how this feature might make things easier; again, just suggesting something that may help in the meantime if you haven't already tried.

1 Like

Yes, that's my usual workaround - when I remember the exact name of the method... :laughing:

A little reminder...

As e.g. in the good old Classic Visual Basic... :blush:

Any thoughts, @support?
Maybe a browser plugin?

My son got a VS Studio plug-in working; download, develop, save, and errors all in VS Studio. I use it for all my Hubitat development. I’ll have to get him to publish it…

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.