Hi,
New user of geany (v0.21 under Ubuntu 12.04) , I tried to add a language. I started using filetypes.c and adding *.prg to C extensions. It works.
I then now tried to add a new filetype in filetype_extentions.conf, and to rename filetypes.c to filetypes.harbour
unfortunately, it doesn't work anymore.
Where do I failed ?
Thanks A+
On 27 January 2016 at 21:23, Alain Aupeix alain.aupeix@wanadoo.fr wrote:
Hi,
New user of geany (v0.21 under Ubuntu 12.04) , I tried to add a language. I started using filetypes.c and adding *.prg to C extensions. It works.
I then now tried to add a new filetype in filetype_extentions.conf, and to rename filetypes.c to filetypes.harbour
You need to read the manual section on adding custom filetypes.
unfortunately, it doesn't work anymore.
Where do I failed ?
Thanks A+
--
Alain Aupeix http://jujuland.pagesperso-orange.fr/ http://pissobi-lacassagne.pagesperso-orange.fr/
U.buntu 12.04 | G.ramps 3.4.9-1 | H.arbour 3.2.0dev (2016-01-24 12:06) | HbIDE (Rev.316) | Five.Linux (r143) | Hw.Gui (2516)
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Le 27/01/2016 12:32, Lex Trotman a écrit :
On 27 January 2016 at 21:23, Alain Aupeix alain.aupeix@wanadoo.fr wrote:
Hi,
New user of geany (v0.21 under Ubuntu 12.04) , I tried to add a language. I started using filetypes.c and adding *.prg to C extensions. It works.
I then now tried to add a new filetype in filetype_extentions.conf, and to rename filetypes.c to filetypes.harbour
You need to read the manual section on adding custom filetypes.
Well, I was reading the documentation, and find that for custom filetypes, the naming convention isn't the same. I have renamed it filetypes.harbour.conf
But thats always not ok.
I have read the doc index.html#custom-filetypes
but I don't find what can be wrong.
I have put a prg file and filetypes.harbour online. https://www.dropbox.com/s/md6tyw1wmxgliuj/Harbour-geany.tar.gz?dl=1
A+
Le 27/01/2016 14:32, Alain Aupeix a écrit :
Le 27/01/2016 12:32, Lex Trotman a écrit :
On 27 January 2016 at 21:23, Alain Aupeix alain.aupeix@wanadoo.fr wrote:
Hi,
New user of geany (v0.21 under Ubuntu 12.04) , I tried to add a language. I started using filetypes.c and adding *.prg to C extensions. It works.
I then now tried to add a new filetype in filetype_extentions.conf, and to rename filetypes.c to filetypes.harbour
You need to read the manual section on adding custom filetypes.
Well, I was reading the documentation, and find that for custom filetypes, the naming convention isn't the same. I have renamed it filetypes.harbour.conf
But thats always not ok.
Does it mean you don't see the new language in the "File type" list in the UI, or that it's not automatically applied to your .prg files?
If the new file tyep doesn't appear at all, it probably means the file is in the wrong place/has wrong permissions.
If it's not detected automatically, it might be because names are case sensitive. if your filetype is named "filetypes.harbour.conf", your entry in filetype_extensions.conf need to mention "harbour" exactly.
If you get the proper filetype yet no syntax highlighting or anything, it's probably that you failed to set the lexer_filetype under stettings in your custom filetype. Custom filetypes have additional keys you need to fill in. (BTW, you probably also want to fill in tag_parser).
Regards, Colomban
Le 27/01/2016 15:04, Colomban Wendling a écrit :
If it's not detected automatically, it might be because names are case sensitive. if your filetype is named "filetypes.harbour.conf", your entry in filetype_extensions.conf need to mention "harbour" exactly.
It was the reason
If you get the proper filetype yet no syntax highlighting or anything, it's probably that you failed to set the lexer_filetype under stettings
it was, then, the case ... Now it's ok
in your custom filetype. Custom filetypes have additional keys you need to fill in. (BTW, you probably also want to fill in tag_parser).
What's the purpose ? Auto-completion ?
I notice too, that with filetypes.c, there were symbols (some were wrong) But now, no more symbols.
How to activate it ? How to have a good parsing of functions and variables ?
Thanks A+
Le 27/01/2016 15:24, Alain Aupeix a écrit :
Le 27/01/2016 15:04, Colomban Wendling a écrit :
[…] in your custom filetype. Custom filetypes have additional keys you need to fill in. (BTW, you probably also want to fill in tag_parser).
What's the purpose ? Auto-completion ?
Parsing symbols from the file, which populates the Symbols pane, and yes, is also used for auto-completion purposes (and type highlighting).
I notice too, that with filetypes.c, there were symbols (some were wrong) But now, no more symbols.
How to activate it ? How to have a good parsing of functions and variables ?
Well, extracting symbols is done by some C code, so if none of the existing parsers work for your case, you'll have to write it -- a CTags parser -- and integrate it. Harder, but not impossible.
However, if C was (mostly) good, just use tag_parser=C and done. You can also try C++, C#, Java, Vala or whatnot, depending on who much alike your language is similar to one of those ("similar" here having a subtle meaning of "how well the parser for it handles your language").
Regards, Colomban
Le 27/01/2016 19:16, Colomban Wendling a écrit :
Le 27/01/2016 15:24, Alain Aupeix a écrit :
Le 27/01/2016 15:04, Colomban Wendling a écrit :
[…] in your custom filetype. Custom filetypes have additional keys you need to fill in. (BTW, you probably also want to fill in tag_parser).
What's the purpose ? Auto-completion ?
Parsing symbols from the file, which populates the Symbols pane, and yes, is also used for auto-completion purposes (and type highlighting).
I notice too, that with filetypes.c, there were symbols (some were wrong) But now, no more symbols.
How to activate it ? How to have a good parsing of functions and variables ?
Well, extracting symbols is done by some C code, so if none of the existing parsers work for your case, you'll have to write it -- a CTags parser -- and integrate it. Harder, but not impossible.
However, if C was (mostly) good, just use tag_parser=C and done. You can also try C++, C#, Java, Vala or whatnot, depending on who much alike your language is similar to one of those ("similar" here having a subtle meaning of "how well the parser for it handles your language").
Thanks, I'll try to do it A+