Wishes for code navigation

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Wishes for code navigation

Scalpel78
Hi, I've got some wishes for the editor and navigating in code.

When a .scad file contains several modules I find the navigation to be less than ideal. I wish there was a way to jump to the definition of a module (F12 in Visual Studio, F2 in QT creator).

In both Visual Studio and QT creator there is also a dropdown at the top of the editor that lists all the methods. Perhaps OpenSCAD could have the same type of dropdown for navigating to modules?

I also wish the module definition navigation understood that some modules are defined in external .scad files, and that they were opened up when navigated to.

This also leads me to another wish - that instead of opening several instances of OpenSCAD, each file should live inside its own tab in the same instance.

What do you think?
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

MichaelAtOz
Administrator
Well everything is possible, but it costs, in development effort, code bloat, learning curve etc.

For me, I'd like dev resources to focus on 1. bug fixes, 2. performance, 3. modelling (for want of a better word) features/convenience (ie enhance the language), the concept of an IDE is down the list for me, granted the Scintilla change is very nice, but for anything big, I'll be using Notepad++ with OpenSCAD Auto-completion (so I just have to type 't' to get 'translate([').

Maybe the best you could do would be to find an open source IDE 'library' that could be more easily incorporated and which is compatible with Scintilla.

Don't mean to be overly critical...
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

MichaelAtOz
Administrator
p.s. Have you seen using external editors, it works quite well.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

tjhowse
Seconded Michael. I love OpenSCAD and use it as my primary modelling
software, but I've never typed a line of code into it. I use notepad++
with the syntax highlighting plugin.

There are function list plugins for notepad++ too. They might fulfill
some of your requirements.

On 2 January 2015 at 08:44, MichaelAtOz <[hidden email]> wrote:

> p.s. Have you seen  using external editors
> <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD>
> , it works quite well.
>
>
>
> -----
> Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
> --
> View this message in context: http://forum.openscad.org/Wishes-for-code-navigation-tp10865p10869.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

tdeagan
I LOVE working with .scad in Notepad++.  It's a pleasure and tremendously more powerful than using the built-in editor.  The only thing about Notepad++ that's missing for me is a concept of 'project', but that's massively outweighed by something as simple as column select (a feature I can't live without.)   Maybe it's just because my .scad dev efforts are too small to require a full IDE yet so Notepad++ meets my needs.  Bigger efforts will eventually benefit from an IDE for .scad work.

But is OpenSCAD (as an app) trying (currently) to be an engine or an IDE?  It helps to have a focus.  The feature list for a good IDE is painfully long (and causes religious wars between developers.)  Kinda sorta aiming at becoming both concurrently is a tough way to make meaningful progress.  My vote is for a more powerful engine first.  

It does make me wonder about trying to write a NetBeans plugin for OpenSCAD (I'd rather shoot myself than use Eclipse.)  I have no idea what's involved, but I'll start reading.  It would be overkill for all but the biggest efforts, but efforts appear to be getting bigger so who knows!

On Thu Jan 01 2015 at 4:54:37 PM tjhowse <[hidden email]> wrote:
Seconded Michael. I love OpenSCAD and use it as my primary modelling
software, but I've never typed a line of code into it. I use notepad++
with the syntax highlighting plugin.

There are function list plugins for notepad++ too. They might fulfill
some of your requirements.

On 2 January 2015 at 08:44, MichaelAtOz <[hidden email]> wrote:
> p.s. Have you seen  using external editors
> <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD>
> , it works quite well.
>
>
>
> -----
> Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
> --
> View this message in context: http://forum.openscad.org/Wishes-for-code-navigation-tp10865p10869.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

Joseph Lenox

Well, if you had a program that was just an stl viewer, could script up vim to compile.

On Jan 1, 2015 5:49 PM, "Tim Deagan" <[hidden email]> wrote:
I LOVE working with .scad in Notepad++.  It's a pleasure and tremendously more powerful than using the built-in editor.  The only thing about Notepad++ that's missing for me is a concept of 'project', but that's massively outweighed by something as simple as column select (a feature I can't live without.)   Maybe it's just because my .scad dev efforts are too small to require a full IDE yet so Notepad++ meets my needs.  Bigger efforts will eventually benefit from an IDE for .scad work.

But is OpenSCAD (as an app) trying (currently) to be an engine or an IDE?  It helps to have a focus.  The feature list for a good IDE is painfully long (and causes religious wars between developers.)  Kinda sorta aiming at becoming both concurrently is a tough way to make meaningful progress.  My vote is for a more powerful engine first.  

It does make me wonder about trying to write a NetBeans plugin for OpenSCAD (I'd rather shoot myself than use Eclipse.)  I have no idea what's involved, but I'll start reading.  It would be overkill for all but the biggest efforts, but efforts appear to be getting bigger so who knows!

On Thu Jan 01 2015 at 4:54:37 PM tjhowse <[hidden email]> wrote:
Seconded Michael. I love OpenSCAD and use it as my primary modelling
software, but I've never typed a line of code into it. I use notepad++
with the syntax highlighting plugin.

There are function list plugins for notepad++ too. They might fulfill
some of your requirements.

On 2 January 2015 at 08:44, MichaelAtOz <[hidden email]> wrote:
> p.s. Have you seen  using external editors
> <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD>
> , it works quite well.
>
>
>
> -----
> Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
> --
> View this message in context: http://forum.openscad.org/Wishes-for-code-navigation-tp10865p10869.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

tdeagan
In reply to this post by tdeagan
Just as an FYI, NetBeans language support looks a bit tedious but basically straightforward.

http://wiki.netbeans.org/How_to_create_support_for_a_new_language

A lot of the lexer and parser stuff may be reusable(ish) from what's in the source .  The syntax highlighting may be at least partially reusable form the Notepad++ implementation.

Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

G. Wade Johnson
In reply to this post by Joseph Lenox
On Thu, 1 Jan 2015 17:59:07 -0600
Joseph Lenox <[hidden email]> wrote:

> Well, if you had a program that was just an stl viewer, could script
> up vim to compile.

I do all of my OpenSCAD development in vim with the OpenSCAD "Automatic
Reload and Compile" option turned on. No need for any vim scripting.

I would definitely prefer the OpenSCAD engine be improved more than
updating IDE features. I see the OpenSCAD editing as a nice-to-have
feature that I will mostly ignore.

For bigger projects, I tend to use the OpenSCAD command line features
and a Makefile to build stuff (all the way through slicing to gcode).
So the OpenSCAD editing features are irrelevant to me.

Just another opinion.

> On Jan 1, 2015 5:49 PM, "Tim Deagan" <[hidden email]> wrote:
>
> > I LOVE working with .scad in Notepad++.  It's a pleasure and
> > tremendously more powerful than using the built-in editor.  The
> > only thing about Notepad++ that's missing for me is a concept of
> > 'project', but that's massively outweighed by something as simple
> > as column select (a feature I can't live without.)   Maybe it's
> > just because my .scad dev efforts are too small to require a full
> > IDE yet so Notepad++ meets my needs.  Bigger efforts will
> > eventually benefit from an IDE for .scad work.
> >
> > But is OpenSCAD (as an app) trying (currently) to be an engine or
> > an IDE? It helps to have a focus.  The feature list for a good IDE
> > is painfully long (and causes religious wars between developers.)
> > Kinda sorta aiming at becoming both concurrently is a tough way to
> > make meaningful progress.  My vote is for a more powerful engine
> > first.
> >
> > It does make me wonder about trying to write a NetBeans plugin for
> > OpenSCAD (I'd rather shoot myself than use Eclipse.)  I have no
> > idea what's involved, but I'll start reading.  It would be overkill
> > for all but the biggest efforts, but efforts appear to be getting
> > bigger so who knows!
> >
> > On Thu Jan 01 2015 at 4:54:37 PM tjhowse <[hidden email]> wrote:
> >
> >> Seconded Michael. I love OpenSCAD and use it as my primary
> >> modelling software, but I've never typed a line of code into it. I
> >> use notepad++ with the syntax highlighting plugin.
> >>
> >> There are function list plugins for notepad++ too. They might
> >> fulfill some of your requirements.
> >>
> >> On 2 January 2015 at 08:44, MichaelAtOz <[hidden email]>
> >> wrote:
> >> > p.s. Have you seen  using external editors
> >> > <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/
> >> Using_an_external_Editor_with_OpenSCAD>
> >> > , it works quite well.
> >> >
> >> >
> >> >
> >> > -----
> >> > Unless specifically shown otherwise above, my contribution is in
> >> > the
> >> Public Domain; To the extent possible under law, I have waived all
> >> copyright and related or neighbouring rights to this work. This
> >> work is published globally via the internet. :) Inclusion of works
> >> of previous authors is not included in the above.
> >> >
> >> > The TPP is no simple “trade agreement.”   Fight it!
> >> http://www.ourfairdeal.org/
> >> > --
> >> > View this message in context: http://forum.openscad.org/
> >> Wishes-for-code-navigation-tp10865p10869.html
> >> > Sent from the OpenSCAD mailing list archive at Nabble.com.
> >> >
> >> > _______________________________________________
> >> > OpenSCAD mailing list
> >> > [hidden email]
> >> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> >>
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> [hidden email]
> >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> >>
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > [hidden email]
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> >
> >


--
The competent programmer is fully aware of the limited size of his own
skull. He therefore approaches his task with full humility, and avoids
clever tricks like the plague.                   -- Edsger Dijkstra

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

tdeagan
In reply to this post by tdeagan
wow! even easier:
https://netbeans.org/community/magazine/html/03/schliemann/

Single file scripting language support approach.  
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

Scalpel78
In reply to this post by tdeagan
tdeagan wrote
But is OpenSCAD (as an app) trying (currently) to be an engine or an IDE?
It helps to have a focus.  The feature list for a good IDE is painfully
long (and causes religious wars between developers.)  Kinda sorta aiming at
becoming both concurrently is a tough way to make meaningful progress.  My
vote is for a more powerful engine first.
Sure, I don't disagree that improving the engine is more important than the IDE, but some minor improvements might still be worth the effort.

Tim asked if OpenSCAD is trying to be an IDE or an engine. I'd say it's an application with both a frontend and a backend. Both are important. Sure, having a perfect IDE isn't worth much if the engine sucks, so I'm inclined to agree that the backend/engine is the most important. But for attracting and keeping new users of OpenSCAD I'm also thinking that the workaround with using an external IDE (yes, I think that is a workaround, not a proper longterm solution) isn't good. The built-in IDE should be good enough so that an external editor isn't required.
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

tdeagan
Scalpel78 wrote
 The built-in IDE should be good enough so that an external editor isn't required.
It can often be difficult to achieve consensus about things like good enough.  One tool that we use at my work a lot is benchmarking, i.e. measuring ourselves against some other site/tool/product that has a level of functionality that we want to reach/exceed.  Consensus on a benchmark can be difficult as well, but generally easier than on a feature by feature basis.  

Are there any (in this case development or editor) apps that you feel have a feature set that would meet the level of functionality that you're visualizing?
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

Michele
I think a good editor should be syntax-directed and offer the following:

1. parenthesis matching
2. auto-indent, aka pretty-print
3. line numbering
4. keyword completion (type "dif<TAB>" and it prints "difference")
5. template generation (type "difference" and get "difference () { }")

I don't need every piece of text in a different color.
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

MichaelAtOz
Administrator
Well you get 1-3 with the upcoming release.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

Joseph Lenox
In reply to this post by Scalpel78


On Jan 2, 2015 2:52 PM, "Scalpel78" <[hidden email]> wrote:
>
> tdeagan wrote
> > But is OpenSCAD (as an app) trying (currently) to be an engine or an IDE?
> > It helps to have a focus.  The feature list for a good IDE is painfully
> > long (and causes religious wars between developers.)  Kinda sorta aiming
> > at
> > becoming both concurrently is a tough way to make meaningful progress.  My
> > vote is for a more powerful engine first.
>
> Sure, I don't disagree that improving the engine is more important than the
> IDE, but some minor improvements might still be worth the effort.
>
> Tim asked if OpenSCAD is trying to be an IDE or an engine. I'd say it's an
> application with both a frontend and a backend. Both are important. Sure,
> having a perfect IDE isn't worth much if the engine sucks, so I'm inclined
> to agree that the backend/engine is the most important. But for attracting
> and keeping new users of OpenSCAD I'm also thinking that the workaround with
> using an external IDE (yes, I think that is a workaround, not a proper
> longterm solution) isn't good. The built-in IDE should be good enough so
> that an external editor isn't required.
>

Personally,  l feel that it is much better to have some support your editor of choice than to continue to tweak OpenSCAD built-in editor. I'd I wanted that editor to do everything that vim can do, I would use vim (and I do).

I do not understand why people would want to have superficial experience with several limited editors when they could be using one powerful editor.

A simple plug in for NetBeans or even eclipse that invokes the viewer in the correct mode would go far with many users.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

tdeagan
In reply to this post by MichaelAtOz
For me, 1-3 is great and I crave chromacoding (colored words.)  I'm less fond of templating.  I don't like having to erase all the extra parens and brackets it puts in because I didn't type things in the order it demands, slows me down and I turn it off.  Keyword completion is okay as long as it's TAB driven.  I hate having to fiddle with the drop down selector between similar names.

I do like function spec tooltips describing the required fields and such. 

But I'm getting all my needs met using Notepad++ along with a huge number of other features.

I kind of imagine the editor in OpenSCAD to be like GLUT in OpenGL, just barely enough to do something as a test, but not a tool designed to do heavy lifting.  I'm somewhat sympathetic to the idea that new users will be too confused to use an editor of choice, so I'll keep chewing on that perspective.  But meeting new users (new programmers really,) needs is a different goalset than meeting the needs of folks with bigger project needs.  Chasing that goal means being an editor development project, which is a shame given how many good ones are out there.

Good discussion!





On Fri Jan 02 2015 at 4:46:27 PM MichaelAtOz <[hidden email]> wrote:
Well you get 1-3 with the upcoming release.




-----
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
--
View this message in context: http://forum.openscad.org/Wishes-for-code-navigation-tp10865p10885.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

doug.moen
In reply to this post by tdeagan
Okay, here's a requirement. Whenever OpenSCAD detects an error, I would like:
(1) to see an error message with the correct file name/line number;
(2) to see the error in context, by displaying the source file, and
the line containing the error marked in red.

One of the cases where this doesn't work today is when the error is in
an included library file. In that case, requirement (2) could be
satisfied by supporting some kind of IDE integration more
sophisticated than just the "Automatic Reload and Compile" option, or
it could be satisfied by supporting tabbed editing, so that multiple
source file tabs can be grouped with a single output pane and error
message pane. In the latter case, OpenSCAD could open an included
source file that contains errors in a tab, so that it can highlight
the lines containing errors.

I'm not arguing that OpenSCAD should necessarily contain its own
sophisticated IDE (I agree engine work trumps this), but it would be
great to at least support proper workflow for reporting and fixing
errors in source code. Also, I think that a significant portion of the
work required for proper error reporting is actually in the engine (by
which I mean the compiler and the run-time, since errors are often not
detectable until runtime since OpenSCAD doesn't use (or need) static
type checking).

PS I looked at the netbeans API link provided by tdeagan, and although
it talks about syntax error highlighting, I don't think this API helps
us to get error messages out of OpenSCAD and into an IDE for the
purpose of highlighting errors in the context of a source file.

On 2 January 2015 at 16:19, tdeagan <[hidden email]> wrote:

> Scalpel78 wrote
>>  The built-in IDE should be good enough so that an external editor isn't
>> required.
>
> It can often be difficult to achieve consensus about things like good
> enough.  One tool that we use at my work a lot is benchmarking, i.e.
> measuring ourselves against some other site/tool/product that has a level of
> functionality that we want to reach/exceed.  Consensus on a benchmark can be
> difficult as well, but generally easier than on a feature by feature basis.
>
> Are there any (in this case development or editor) apps that you feel have a
> feature set that would meet the level of functionality that you're
> visualizing?
>
>
>
> --
> View this message in context: http://forum.openscad.org/Wishes-for-code-navigation-tp10865p10883.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

tdeagan
doug.moen wrote
PS I looked at the netbeans API link provided by tdeagan, and although
it talks about syntax error highlighting, I don't think this API helps
us to get error messages out of OpenSCAD and into an IDE for the
purpose of highlighting errors in the context of a source file.
I agree, the quick version doesn't do this, but I know a lot of other languages have some means of doing so with NetBeans so I'll investigate.

I am really interested in this set of requirements.  Constructing an advanced editor capability as an artifact of creating a more powerful debugging experience (rather than as YAEditor).  That bridges the engine/UI question in a really interesting way.  I'm not sure what the command line does at this point (I've never used it when having errors, be nice if there was a super simple script that had a target flaw for debugging.)

interesting stuff!!
Reply | Threaded
Open this post in threaded view
|

Re: Wishes for code navigation

Joseph Lenox
In reply to this post by doug.moen

What about an ability to redirect the errors and warnings from the console to stdout or stderr? That way you could easily have a parser in the editor for syntax highlights in editor of choice.

What would be slick would be able to figure out on a statement by statement basis if the volume of a construct is approximately 0.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org