Line number in the editor ?

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

Line number in the editor ?

runsun
Hi all, is there a plan to add line number to the editor ? When I see something like:

   Parser error in line 191: syntax error
   ERROR: Compilation failed!

I have to copy and paste the entire file to another editor in order to see where line 191 is.

Bty, I'm new to OpenScad. Many thanks for such a wonderful project and glad to see an active community. I enjoy it very much.
$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

tjhowse
The default answer to requests for editor improvements is to use an
external editor. There's a setting in openscad to enable
auto-reloading of the file when a change is detected. You can then
load a syntax highlighter plugin for your text editor of choice and
work in a more familiar and featured environment. Personally I use
Notepad++.

On 19 March 2014 11:35, runsun <[hidden email]> wrote:

> Hi all, is there a plan to add line number to the editor ? When I see
> something like:
>
>    Parser error in line 191: syntax error
>    ERROR: Compilation failed!
>
> I have to copy and paste the entire file to another editor in order to see
> where line 191 is.
>
> Bty, I'm new to OpenScad. Many thanks for such a wonderful project and glad
> to see an active community. I enjoy it very much.
>
>
>
> -----
> Runsun Pan, PhD
> --
> View this message in context: http://forum.openscad.org/Line-number-in-the-editor-tp7356.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

runsun
Thx. that's a work around. I was just trying not to use an external editor to avoid (1) opening too many programs at the same time and (2) the need of switching back and forth.
$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

donbright
In reply to this post by runsun
when there is an error there is supposed to be a red-highlight on the line where the error occured. does this not work on your machine / os? which version of openscad are you using? (Help/about)


On Tue, Mar 18, 2014 at 8:35 PM, runsun <[hidden email]> wrote:
Hi all, is there a plan to add line number to the editor ? When I see
something like:

   Parser error in line 191: syntax error
   ERROR: Compilation failed!

I have to copy and paste the entire file to another editor in order to see
where line 191 is.

Bty, I'm new to OpenScad. Many thanks for such a wonderful project and glad
to see an active community. I enjoy it very much.



-----
Runsun Pan, PhD
--
View this message in context: http://forum.openscad.org/Line-number-in-the-editor-tp7356.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

Len Trigg
In reply to this post by runsun
BTW, the line number isn't always correct anyway -- if you have an
include at the top of the file, the line number includes the length of
the included file :-(. (For this reason, I usually put my includes at
the end of the file) (See
https://github.com/openscad/openscad/issues/214)


On 19 March 2014 14:35, runsun <[hidden email]> wrote:

> Hi all, is there a plan to add line number to the editor ? When I see
> something like:
>
>    Parser error in line 191: syntax error
>    ERROR: Compilation failed!
>
> I have to copy and paste the entire file to another editor in order to see
> where line 191 is.
>
> Bty, I'm new to OpenScad. Many thanks for such a wonderful project and glad
> to see an active community. I enjoy it very much.
>
>
>
> -----
> Runsun Pan, PhD
> --
> View this message in context: http://forum.openscad.org/Line-number-in-the-editor-tp7356.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

runsun
In reply to this post by donbright
Yes there often is a red highlight showing where the error is most of the time, but for some reason I couldn't find it sometimes.  Will check if it is repeatable if I see it again.

Btw I am using 2014.03.11 on Linux Mint 14.  
$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

MichaelAtOz
Administrator
What I find annoying is no line numbers for warnings.

WARNING: Ignoring unknown module 'differece'.
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: Line number in the editor ?

doug.moen
The red highlighting has worked well for me so far, but I'm just a beginner, and I'm only running short programs that fit on the screen with no include files.

For more serious work, if you are dealing with multiple messages and multiple source files, then navigating to a warning or error by line number is not optimal. It would be better if the editor area supported tabs, and if clicking on a warning or error opened the source file in a new tab (if not already open), scrolled to the offending line, and highlighted it. If we had that, then maybe we wouldn't need to display line numbers.


On 19 March 2014 22:30, MichaelAtOz <[hidden email]> wrote:
What I find annoying is no line numbers for warnings.

/WARNING: Ignoring unknown module 'differece'./



--
View this message in context: http://forum.openscad.org/Line-number-in-the-editor-tp7356p7406.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
RGH
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

RGH

Most of my errors seem to be basic forgetting brackets or braces. Most of the time the highlighting and line numbers are nowhere near the actual error!

Frankly I'd like to see an error generated when I've misspelt translate or (even worse) centre and colour!

On 20 Mar 2014 10:06, "doug moen" <[hidden email]> wrote:
The red highlighting has worked well for me so far, but I'm just a beginner, and I'm only running short programs that fit on the screen with no include files.

For more serious work, if you are dealing with multiple messages and multiple source files, then navigating to a warning or error by line number is not optimal. It would be better if the editor area supported tabs, and if clicking on a warning or error opened the source file in a new tab (if not already open), scrolled to the offending line, and highlighted it. If we had that, then maybe we wouldn't need to display line numbers.


On 19 March 2014 22:30, MichaelAtOz <[hidden email]> wrote:
What I find annoying is no line numbers for warnings.

/WARNING: Ignoring unknown module 'differece'./



--
View this message in context: http://forum.openscad.org/Line-number-in-the-editor-tp7356p7406.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

Shaina Sabarwal
In reply to this post by runsun
On Wed, Mar 19, 2014 at 7:05 AM, runsun <[hidden email]> wrote:
> Hi all, is there a plan to add line number to the editor ? When I see
> something like:
>
>    Parser error in line 191: syntax error
>    ERROR: Compilation failed!
>
> I have to copy and paste the entire file to another editor in order to see
> where line 191 is.

Yes, editor needs improvements and I'll be working on it. This concept
of adding line number before each line of the code is there in my GSoC
proposal.


--
Shaina Sabarwal
blog: shainasabarwal.wordpress.com
github: github.com/shaina7837

To die is nothing, but it is terrible not to live.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

jbeale
In reply to this post by donbright
donbright wrote
when there is an error there is supposed to be a red-highlight on the line
where the error occurred.
I am using OpenSCAD version 2014.03 on two computers; Windows 7 and Windows XP. I have had plenty of errors, but I have never seen a red highlight anywhere. Without line numbers in the editor, and with the line number offset from included files, it is hard to find the error even using an external editor.   It would be nice if the line containing the error was printed out.

However I wasn't aware I could put the includes at the end, so that is good to know.

I'm also surprised the compiler simply issues a warning if a variable is undefined, and proceeds to render it anyway. This has caused me some debugging problems. For example, the below OpenSCAD file (in its entirety!) generates a small pentagon, 1 unit high, which I would not have expected. would like at least the option for strict error checking, to prevent this from appearing to work.

cylinder(r = foobar, h = zowiee);
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

jbeale
As a followup, I tried "sudo apt-get install openscad" on a Raspberry Pi. This gives me version 2012.06.06 and it isn't fully working (crashes when you render anything, OpenGL issue?) but it actually does show a red highlight on syntax errors, something I had never seen on the current Windows versions.  Interesting, so I guess I can use an R-Pi as my syntax checker :-)
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

MichaelAtOz
Administrator
In reply to this post by jbeale
With 2014.03, Windows 7, Red shows on error line for me, always has. Can't explain why you don't get one.

As you can read, there is work to introduce a new editor, which should have line numbers.

Rpi is not supported. Some bits may work. Search other topics if you want more info. Open GL ES vs full Open GL.
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: Line number in the editor ?

hagen
In reply to this post by donbright
I try to avoid syntax errors :) , because the 'black on red' is unreadable for a (mildly) color blind person like me.
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

tp3
hagen wrote
I try to avoid syntax errors :) , because the 'black on red' is unreadable for a (mildly) color blind person like me.
This will get easier too with an additional error marker in the margin area that shows the line numbers.

-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

fukanchik
Here's how code, adapted from here: how to add lines numbers to : QTextEdit? look like in my build of openscad:
Line num screenshot
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

Triffid Hunter
In reply to this post by runsun
On 19 March 2014 13:59, runsun <[hidden email]> wrote:
Thx. that's a work around. I was just trying not to use an external editor to
avoid (1) opening too many programs at the same time

If your computer can't handle openscad and a text editor, it probably can't handle openscad in the first place
 
and (2) the need of
switching back and forth.

that's why I set openscad to be 'always on top' :P



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

runsun
It's true. My issue, however, is not on the computer, but on the tendency in my nature trying not to make a process more complicated unless necessary.  One word, laziness, is sufficient to describe it :)
$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

Triffid Hunter
And this is also precisely why openscad only has a crude editor built in, and an excellent feature to support an external, presumably far more advanced one ;)


On 13 August 2014 00:53, runsun <[hidden email]> wrote:
It's true. My issue, however, is not on the computer, but on the tendency in
my nature trying not to make a process more complicated unless necessary.
One word, laziness, is sufficient to describe it :)



-----
$ Runsun Pan, PhD
$ -- OpenScad_DocTest: doc and unit test ( Github , Thingiverse  )
$ -- Linux Mint 17 MATE 64bit  + OpenSCAD 2014.05.31 snapshot
$ -- Linux Mint 17 MATE 64bit + Wine 1.6.2 + OpenSCAD for Windows 2014.07.22 snapshot


--
View this message in context: http://forum.openscad.org/Line-number-in-the-editor-tp7356p9312.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Line number in the editor ?

tp3
Triffid Hunter wrote
And this is also precisely why openscad only has a crude editor built in,
and an excellent feature to support an external, presumably far more
advanced one ;)
Sorry for taking away that argument soon: https://github.com/openscad/openscad/pull/905 :-)

I tend to use the internal editor pretty much due to the same reason... to lazy to use something else.
-- Torsten