Skip to content
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

🐞 Detect File Language Via shebang #46

Closed
wjk opened this issue Jun 9, 2023 · 3 comments · Fixed by #47 or CodeEditApp/CodeEdit#1334
Closed

🐞 Detect File Language Via shebang #46

wjk opened this issue Jun 9, 2023 · 3 comments · Fixed by #47 or CodeEditApp/CodeEdit#1334
Assignees
Labels
bug Something isn't working

Comments

@wjk
Copy link

wjk commented Jun 9, 2023

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
@wjk wjk added the bug Something isn't working label Jun 9, 2023
@luah5
Copy link
Member

luah5 commented Jun 9, 2023

CodeEdit currently cannot infer the file type without the file extension, just add the proper extension and syntax highlighting will work. Thanks for reporting this issue!

@austincondiff
Copy link
Contributor

It is something we should look into though.

@thecoolwinter
Copy link
Contributor

thecoolwinter commented Jun 16, 2023

Moving this to CodeEditLanguages as the language detection is currently performed in that package.

@thecoolwinter thecoolwinter transferred this issue from CodeEditApp/CodeEdit Jun 16, 2023
@thecoolwinter thecoolwinter changed the title 🐞 Syntax highlighting doesn’t work 🐞 Detect File Language Via shebang Jun 16, 2023
@thecoolwinter thecoolwinter self-assigned this Jun 17, 2023
@thecoolwinter thecoolwinter transferred this issue from CodeEditApp/CodeEditSourceEditor Jun 17, 2023
@github-project-automation github-project-automation bot moved this from 🏃‍♂️ In Progress to 🏁 Complete in CodeEdit Project Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏁 Complete
4 participants