Page 1 of 2

toggle line numbers & inline errors (View)

Posted: Mon Jul 29, 2013 4:48 am
by petah
Hi Eran,

I'd like to add keyboads accelerators for 'toggle line numbers' and 'toggle inline errors', can I just add them to the XRC files or are they automatically generated from wxCrafter and would be zapped?

I love the inline error reporting btw but once I start fixing the error it's weird the cursor jumps around the line, plus when I recompile and the inline error disappears I always wonder if I accidentally deleted a line :)

Wrt line numbers, I generally have them off but when fixing some external files (Lua, javascript) I have to turn them on temporarily.

thx!

-- p

Re: toggle line numbers & inline errors (View)

Posted: Mon Jul 29, 2013 6:22 pm
by solewalker
+1 for toggle line numbers, its not needed always though. but whats 'inline errors', normally I have to see in the output pane what the error is, but it would be cool if we could see error or warnings by just hovering cursor over red/yellow arrow or a text annotation pop up, something like that. I know its not easy just saying :)

Re: toggle line numbers & inline errors (View)

Posted: Mon Jul 29, 2013 7:07 pm
by petah
solewalker wrote:whats 'inline errors', normally I have to see in the output pane what the error is, but it would be cool if we could see error or warnings by just hovering cursor over red/yellow arrow or a text annotation pop up, something like that. I know its not easy just saying :)
It's not a hover (which would be annoying since it'd occlude source) but inlined, non-editable text below the error with a light-red background; it's really cool. The cursor automatically skips around it when moving around, it's hard to explain with words, you have to try it out. Maybe you don't see it because it's only in CL trunk, which is all I use.

Hope I didn't give away a secret ;)

cheers,

-- p

Re: toggle line numbers & inline errors (View)

Posted: Mon Jul 29, 2013 8:23 pm
by solewalker
oh, wow, I built 5.3 now and amazing :) how did I live without this.

Image

Edit: Then +2 for "toggle inline errors/warnings reporting", one thing, e.g. if I miss a ';' on line 11, then the arrow is shown in line 12, inline error is after 12, so if I want to toggle (if available) inline error, in which line I would put my caret and press key short-cut, of course it must be either line 11 or 12.

Re: toggle line numbers & inline errors (View)

Posted: Mon Jul 29, 2013 9:34 pm
by solewalker
I know this feature is experimental, but I made a weird discovery, if there is both error and warning in a single line, it shows warnings which hides the error message, this code produces both error and a warning at line 10,

Code: Select all

int main(int argc, char **argv)
{
   int i;
   i printf("hello world\n");
   
	return 0;
}
Build log :

Code: Select all

E:/workspace/test/main.cpp:10:6: error: expected ';' before 'printf'
E:/workspace/test/main.cpp:10:29: warning: statement has no effect [-Wunused-value]
It shows like this, does not show the error message,
Image

It would be perfect, if the error message is given higher priority when there is both an error and warning in a same line. Also I would like to disable/enable warnings (i can disable both using "Errors/warnings markers:" but not individually) to show up as inline messages. As it disturbs me and not as important as errors. Usually I pay attention to warnings less often may be once in a day, its like optimization, its always done later in the project. I hope I am clear :)

Re: toggle line numbers & inline errors (View)

Posted: Mon Jul 29, 2013 9:47 pm
by eranif
solewalker wrote:It would be perfect, if the error message is given higher priority when there is both an error and warning in a same line
I saw this and my plan is the concatenate the message into a single message based on the line number

I would also like to remove the file part from the error message based on the regex used so the message will be:
"statement has no effect"

Eran

Re: toggle line numbers & inline errors (View)

Posted: Mon Jul 29, 2013 10:05 pm
by solewalker
I saw this and my plan is the concatenate the message into a single message based on the line number

I would also like to remove the file part from the error message based on the regex used so the message will be:
"statement has no effect"
That would be great ! I would still want to disable/enable warnings, if its not that much of a work ;)

Re: toggle line numbers & inline errors (View)

Posted: Tue Jul 30, 2013 8:15 am
by eranif
Here is the fix I applied to trunk:
1.png
Eran

Re: toggle line numbers & inline errors (View)

Posted: Tue Jul 30, 2013 5:39 pm
by solewalker
That's so fast. How do I access the trunk, I tried "git pull origin" but it says already up-to-date.
Another thing, imho "error:' and "warning:" part should have been there, because its confusing, which one is error and which one is warning. But thanks for the quick update :)

Re: toggle line numbers & inline errors (View)

Posted: Tue Jul 30, 2013 6:31 pm
by eranif
solewalker wrote:That's so fast. How do I access the trunk, I tried "git pull origin" but it says already up-to-date.
Another thing, imho "error:' and "warning:" part should have been there, because its confusing, which one is error and which one is warning. But thanks for the quick update :)
My goal is to have different color for each message type (its basically line oriented).
Keeping the error/warning is not possible because the regex allows me to remove the entire file:line: prefix but not part of it...

Eran