New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline comments don't work for Python #2799
Comments
The highlighting lexer comes from a different project Scintilla and doesn't know about settings in 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. [Edit: you might need to change the mapping in |
A lot of issues with Geany seem to come from Scintilla (like this 11 year old one); is there any alternative being looked into - like GtkSourceView or something? |
Docstrings are syntactically strings see 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. |
In filetypes.python we have:
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 text was updated successfully, but these errors were encountered: