You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead, I would like to request that Spyder have a fallback highlighter. If no other highlighters can be used, maybe Spyder should use Pygments' autodetection functions ( http://pygments.org/docs/api/; I think get_lexer_for_filename would be enough; guess_lexer would probably be too slow). This would add immediate support for all file types supported by Pygments, including lexer plugins.
To be completely useful, I would also suggest an option to disable syntax highlighting. That way, if the autodetection guesses the wrong file type, highlighting can be disabled on that file, and then you're no worse off than the current Spyder, which would not have highlighted the file at all. The ability to select a syntax highlighting scheme would be even better, but not strictly necessary. And finally, a GUI for making a simple lexer plugin through Spyder would round out the features, but that's much farther in the future.
This is a very well thought proposal and something I'd like to see in a future version.
Do I smell a pull request coming from you? Otherwise, you'll have to wait at least until our 2.5 version because plans for 2.4 are almost settled and well under way :)
From randy.he...@clockworklab.net on 2014-09-13T07:25:15Z
Spyder supports syntax highlighting of some files through Pygments. However, each file type must be manually added to Spyder as seen here: https://bitbucket.org/spyder-ide/spyderlib/src/4954d59d388e09b136b324141d595a4104266a1c/spyderlib/widgets/sourcecode/syntaxhighlighters.py?at=default#cl-837 This means that Spyder does not make use of all of the syntax highlighters provided by Pygments (and there are a lot: http://pygments.org/docs/lexers/ ). Adding support for any additional language requires changes to Spyder's source. This also means that, if I create a Pygments plugin ( http://pygments.org/docs/plugins/ ), there is no way to make Spyder use it without manually editing Spyder's code.
Instead, I would like to request that Spyder have a fallback highlighter. If no other highlighters can be used, maybe Spyder should use Pygments' autodetection functions ( http://pygments.org/docs/api/; I think get_lexer_for_filename would be enough; guess_lexer would probably be too slow). This would add immediate support for all file types supported by Pygments, including lexer plugins.
To be completely useful, I would also suggest an option to disable syntax highlighting. That way, if the autodetection guesses the wrong file type, highlighting can be disabled on that file, and then you're no worse off than the current Spyder, which would not have highlighted the file at all. The ability to select a syntax highlighting scheme would be even better, but not strictly necessary. And finally, a GUI for making a simple lexer plugin through Spyder would round out the features, but that's much farther in the future.
FYI, my current setup:
Spyder Version: 2.3.0
Python Version: 3.4.1
Qt Version : 4.8.5, PyQt4 (API v2) 4.10.4 on Linux
pyflakes >=0.6.0: None (NOK)
pep8 >=0.6 : None (NOK)
IPython >=0.13 : 2.2.0 (OK)
pygments >=1.6 : 1.6 (OK)
sphinx >=0.6.6 : None (NOK)
psutil >=0.3 : None (NOK)
rope >=0.9.2 : None (NOK)
matplotlib >=1.0: None (NOK)
sympy >=0.7.0 : None (NOK)
pylint >=0.25 : None (NOK)
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1966
The text was updated successfully, but these errors were encountered: