[Github-comments] [geany/geany] Add Prolog filetype support (PR #3171)

elextr notifications at github.com
Wed Apr 27 23:57:23 UTC 2022


@rdipardo just to expand on @techee comment above, the way the highlighting works is:

1. the lexer identifies syntactic entities and marks them with an enumeration (the `SCE_VISUALPROLOG_STRING_VERBATIM` values)
2. Geany maps those enumerations to a string name so humans can refer to it
3. Filetype files map that string to a style name, this is the mapping @techee is talking about
4. Colour scheme files map style names to actual styles

This system allows colour schemes (aka themes) to just specify a single set of styles and have similar entities in all languages be styled the same, but it depends on filetypes files mapping the syntactic entities in a sensible manner.

There is no style name for a "variable" because almost no language allows identifiers to be classed as variables (as distinct from functions and types and other stuff) purely syntactically, so no colour schemes will define a style for it, thats why @techee suggested the "parameter" style name.

It is possible to map to a style in the filetype file, but that then won't change when the colour scheme changes, so a dark colour thats ok on light schemes may not be visible on dark schemes, so its always better to map to existing style names, even if their semantics are slightly different.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3171#issuecomment-1111588566
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3171/c1111588566 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220427/fb2e4e9d/attachment.htm>


More information about the Github-comments mailing list