Hello,
oh. So, the compiler output should look like e.g. GCC outputs, which Geany does parse well?
mkl2mkp_en-0.25.c:3211:11: error: 'comp_adres' undeclared (first use in this function)
Br, Vitali
Lex Trotman [elextr@gmail.com] kirjoitti:
On 7 August 2013 18:38, Vitali Samurov vitali.s@elisanet.fi wrote:
Hello,
I'm trying to add a new compiler toolchain in Geany and would like to highlight an error (waring) line in the code by using 'Error regular expression' feature.
I have added this: (.+)\line\s+([0-9]+)
And was able to get line 'E011 The value of symbolic....' colored in RED:
/mkl2mkp_en -i "DIYGeigerCounter_ver_1-3.mkl" (in directory: /../Temp) MKP file DIYGeigerCounter_ver_1-3.mkl E011 The value of symbolic reference is not defined in line 77 - RECEIVE1 First page: 0 Length (pages): 6 Compilation failed.
But editor does not show /highlight the line in edit window. Is it possible to do that?
Yes, but the regular expression has to have two captures, one that extracts the line number and one that extracts the filename so it knows which file and which line. And the filename and line no must be in the same line in your compiler output. That does not appear to be the case in the output above (but it may simply be wrapped by the mailer).
Cheers Lex
Br, Vitali
--
--- Sent from the web-mail ---
______________________________**_________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-**bin/mailman/listinfo/usershttps://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 7 August 2013 20:23, Vitali Samurov vitali.s@elisanet.fi wrote:
Hello,
oh. So, the compiler output should look like e.g. GCC outputs, which Geany does parse well?
Well, certainly gcc outputs have been used most :)
It would be the best course to use that if your compiler can be configured to produce it. If it is a very good copy of gcc it may work with the built-in decoding and no regex will be needed.
But for example the regex can be used with Python output like
SyntaxError: ('invalid syntax', ('untitled.py', 28, 5, '\tfor:\n'))
can also be parsed because it has the filename untitled.py and line number 28 in the output.
The requirement for each line to have both is because compilers like C or C++ can interleave error messages from included headers with errors from the .c file so each line must be fully identified to allow marking in the source file.
Cheers Lex
mkl2mkp_en-0.25.c:3211:11: error: 'comp_adres' undeclared (first use in this function)
Br, Vitali
Lex Trotman [elextr@gmail.com] kirjoitti:
On 7 August 2013 18:38, Vitali Samurov vitali.s@elisanet.fi wrote:
Hello,
I'm trying to add a new compiler toolchain in Geany and would like to highlight an error (waring) line in the code by using 'Error regular expression' feature.
I have added this: (.+)\line\s+([0-9]+)
And was able to get line 'E011 The value of symbolic....' colored in
RED:
/mkl2mkp_en -i "DIYGeigerCounter_ver_1-3.mkl" (in directory: /../Temp) MKP file DIYGeigerCounter_ver_1-3.mkl E011 The value of symbolic reference is not defined in line 77 -
RECEIVE1
First page: 0 Length (pages): 6 Compilation failed.
But editor does not show /highlight the line in edit window. Is it possible to do that?
Yes, but the regular expression has to have two captures, one that extracts the line number and one that extracts the filename so it knows which file and which line. And the filename and line no must be in the same line in your compiler output. That does not appear to be the case in the output above (but it may simply be wrapped by the mailer).
Cheers Lex
Br, Vitali
--
--- Sent from the web-mail ---
______________________________****_________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-****bin/mailman/listinfo/usershttps://lists.geany.org/cgi-**bin/mailman/listinfo/users
<htt**ps://lists.geany.org/cgi-bin/**mailman/listinfo/usershttps://lists.geany.org/cgi-bin/mailman/listinfo/users
______________________________**_________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-**bin/mailman/listinfo/usershttps://lists.geany.org/cgi-bin/mailman/listinfo/users
--
--- Sent from the web-mail ---
______________________________**_________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-**bin/mailman/listinfo/usershttps://lists.geany.org/cgi-bin/mailman/listinfo/users
Hey geany users,
I'm trying to change the the fileheader for C++ files to multiline comments (/* ... */) instead of (//).
What I've tried so far is to edit "filetypes.cpp" and set: comment_open=/* comment_close=*/
This works fine but affects my "toggle-comment" which is not what I want.
In the "[styling]" section there are options: comment=comment commentline=comment
but I don't know if they can help with my problem and did not find something about it in the documentation. It would be nice if someone knew a solution to this.
A second question (but not that urgend) would be how to remove the indentation in the fileheader. I have no idea where this is specified (obivously not in the template "main.cxx" or the "gpl"-file).
Kind regards, Johannes
Hi Johannes,
Le 07/08/2013 14:41, Johannes Lange a écrit :
Hey geany users,
I'm trying to change the the fileheader for C++ files to multiline comments (/* ... */) instead of (//).
What I've tried so far is to edit "filetypes.cpp" and set: comment_open=/* comment_close=*/
This works fine but affects my "toggle-comment" which is not what I want.
You should have also a "comment_single" setting, which for C++ should be set to "//", and it should then normally work like you want. BTW, this is the default, at least for Geany 1.23. Which version do you use?
Checking the log tells me the separate single-line comment support was added in 0.21, but that a bug leading to use single-line comments for multiline blocks was fixed in 1.23.
In the "[styling]" section there are options: comment=comment commentline=comment
but I don't know if they can help with my problem and did not find something about it in the documentation. It would be nice if someone knew a solution to this.
This has nothing to do with your issue, it's only used to chose the coloring for syntax highlighting.
A second question (but not that urgend) would be how to remove the indentation in the fileheader.
Which indentation?
Cheers, Colomban
Hi Colomban,
thanks for your reply! I'm using version 0.20 at the moment, so that doesn't work (didn't even know that it's so outdated). I've got an old openSUSE version, so there is no newer version of geany in the repositories at the moment, but I'll update my system soon and then try your solution :-) Until then I'll just use a workaround with snippets.
Yes, after I sent the mail, I realized that the "[styling]" thing was rubbish.
About the indentation: everything in the fileheader is indented with 6 whitespaces like this:
/* * main.cpp * * [license etc.] * */
Kind regards, Johannes
------------ /Original-Nachricht/ ------------ *Betreff:* Re: [Geany-Users] fileheader comment-type *Von:* Colomban Wendling lists.ban@herbesfolles.org *An:* users@lists.geany.org *Datum:* Wed, 07 Aug 2013 15:05:14 +0200
Hi Johannes,
Le 07/08/2013 14:41, Johannes Lange a écrit :
Hey geany users,
I'm trying to change the the fileheader for C++ files to multiline comments (/* ... */) instead of (//).
What I've tried so far is to edit "filetypes.cpp" and set: comment_open=/* comment_close=*/
This works fine but affects my "toggle-comment" which is not what I want.
You should have also a "comment_single" setting, which for C++ should be set to "//", and it should then normally work like you want. BTW, this is the default, at least for Geany 1.23. Which version do you use?
Checking the log tells me the separate single-line comment support was added in 0.21, but that a bug leading to use single-line comments for multiline blocks was fixed in 1.23.
In the "[styling]" section there are options: comment=comment commentline=comment
but I don't know if they can help with my problem and did not find something about it in the documentation. It would be nice if someone knew a solution to this.
This has nothing to do with your issue, it's only used to chose the coloring for syntax highlighting.
A second question (but not that urgend) would be how to remove the indentation in the fileheader.
Which indentation?
Cheers, Colomban _______________________________________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users