Skip to content

🐞 Detect File Language Via shebang #46

@wjk

Description

@wjk

Description

When I open a file in the editor, there is no syntax highlighting. Everything is black. Furthermore, the right-hand panel says the file is of type “Swift Source.” That is incorrect; the file is Python, as can be identified by the shebang statement on the first line. (I don’t know if CodeEdit looks for these, however.) The file has no extension.

When I change the editor type to Python manually, nothing happens. The text is still all black.

To Reproduce

  1. Clone stevenshiau/clonezilla and open it in CodeEdit
  2. Select the file bin/gen-torrent-from-ptcl in the file browser
  3. Observe the black text

Expected Behavior

Bright and informative colors.

Version Information

CodeEdit: 0.0.3-alpha (32)
macOS: 13.4 (22F66)
Xcode: 15.0 (15A5160n)

Additional Context

I do not know if CodeEdit is smart enough to look the shebang line of a file to detect which syntax highlighter should be used. (CotEdit and other editors can do this.) If not, it should be.

Furthermore, if the file type truly cannot be determined, the default should be plain text.

Screenshots

Screenshot 2023-06-09 at 5 27 35 PM

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

🏁 Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions