I'm creating a custom filetype. The language is based on C#. `lexer_filetype` should be set to `cs`, or `CSharp`, or even `C#`? This is very unclear to me.
There is no csharp lexer, it uses the C lexer [here](https://github.com/geany/geany/blob/e5680fe85de536fc61ff0f2d4eadc54171d6c982...).
So it should be `C`.
I'm also developing a custom filetype for a language based on Ada. Please let me know the values for `lexer_properties` and `lexer_filetype`. Thank you.
Look at the `filetypes.xxx` file, if it has no `lexer_filetype` setting but the language has highlighting then it has its own lexer and can be a value for a custom filetype's `lexer_filetype` setting, so `Ada`.
There are no properties set in `filetypes.ada` for Ada, but it would be best for you to check the [code](https://github.com/geany/geany/blob/master/scintilla/lexilla/lexers/LexAda.c...) to be sure there are none.
I'm still not really get it. For example, I'm developing a language based on FreeBasic. What are the values for `styling` and `lexer_filetype`? I'm currently set both to `FreeBasic`.
To be clear, there are two categories of filetypes, built-in and custom.
Lexers and ctags parsers are pieces of code obtained from external projects that are compiled into Geany.
Built-in filetypes (like C and Ada) are defined in the Geany code so they can point to the lexer and parser code they use. So there is no need to define those in the filetype file. Built-in filetypes have filetype file names like `filetype.xxx` and no `lexer_filetype` or `parser_filetype` setting.
Custom filetypes (like Scala) are not built in to Geany, instead they are defined by the existence of a `filetypes.xxx.conf` file in one of the search paths. Since they are not compiled in they can't point to a lexer, instead they use the `lexer_filetype` setting to indirectly select the lexer by specifying the name of a built-in filetype that uses the relevant lexer. Similarly `parser_filetype` specifys the parser.
Options such as `lexer_properties` are defined by the lexer and are therefore the same for any filetype that uses the lexer, whether built-in or custom. Lexer properties normally have default values so the filetypes file doesn't have to mention one that it does not want to change. So filetypes files do not always contain a full list of properties, especially if a lexer added a new property and an existing filetype does not use it. Unfortunately the Lexilla project where the lexers are from does not document properties of the lexers, so thats why I suggest that you need to check the code of any lexer you want to use to see what properties it has (and what they do).
github-comments@lists.geany.org