In filetypes.python we have:
``` # single comment char, like # in this file comment_single=#\s # multiline comments comment_open=""" comment_close=""" ```
But none of these multi-line examples results in a comment or even heredoc, its just a string.
For some reason python syntax highlighting is ignoring comment_open/close and treating block comments as multiline comments:

So how do we get docstrings to show up as multiline comments?
The highlighting lexer comes from a different project [Scintilla](www.scintilla.org) and doesn't know about settings in `filetypes.python`. The settings in `filetypes.python` are only used by the various comment insert functions in Geany.
If the Python lexer makes multi-line strings a different syntax entity to single quote strings you can adjust the colour scheme to show them differently, otherwise you will need to teach the lexer in Scintilla to parse them as different entities.
A lot of issues with Geany seem to come from Scintilla (like [this](https://sourceforge.net/p/scintilla/bugs/1078/) 11 year old one); is there any alternative being looked into - like GtkSourceView or something?
Docstrings are syntactically __strings__ [see](https://docs.python.org/3/reference/lexical_analysis.html) so they will show as that, the fact that they are considered docstrings is actually just a convention, and not part of the Python language at all. So greater semantic analysis would be needed to identify docstrings if they were to be highlighted differently. And they seem to be highlighted the same as all other strings in gedit too (a GTKsourceview editor).
Compare the speed of a GTKsourceview based editor and a Scintilla based editor opening a large file, Scintilla is much faster to highlight than gtksourceview, thats because Scintilla lexers are C++ not regexen. But that does allow the possibility for smarter lexers too, but "somebody" has to write them and C++ takes more effort.
Scintilla supports lots of languages and its unreasonable to expect the maintainer to support them all.
So clearly the Scintilla issue 1078 is not important enough for anyone to contribute a fix after the maintainer didn't. Scintilla (and Geany) rely on volunteers to support various languages, so if nobody volunteered the fix its not causing enough problems.
Closed #2799.
github-comments@lists.geany.org