Feature Request: Syntax highlight by #!

已回答

I spoke with the PyCharm devs at PyCon 2017 about this, and was directed to here.  It would be nice if the editor recognized #! lines and applied syntax highlights accordingly.  I work with many configuration files.  Some are json, some are yaml, some are completely different; but they all have the same file extension.  Currently syntax highlighting appears to only be defined by file name/extension.  It would be great to be able to  specify highlighting another way; using #! came to mind first for me.  Having to define the correct type by individual filename and path like we do now for hundreds of files is a gigantic pain.

0

Hi Samc! This feature is already supported but specific plugins need to detect their languages by itself. E.g. PyCharm correctly understands #!/usr/local/bin/python for example. Not sure is shebang for json makes sense, it's not an executable script.

0

请先登录再写评论。