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

Doesn't detect files with shebang #23

Open
DanielPower opened this issue Feb 9, 2016 · 2 comments
Open

Doesn't detect files with shebang #23

DanielPower opened this issue Feb 9, 2016 · 2 comments

Comments

@DanielPower
Copy link

Atom won't detect files that don't have the extension '.lua' even if the file begins with a lua shebang.

If a file begins with
#!/usr/bin/lua5
#!/usr/bin/lua5.1
#!/usr/bin/lua5.2
etc., Atom should detect it and provide syntax highlighting, the same way it does for a Python file with the shebang
#!/usr/bin/python3

@Rochet2
Copy link
Contributor

Rochet2 commented Jun 26, 2016

I created a new file, named it warnings2.lua and saved this to it: #!/usr/bin/python
Upon opening it in atom was recogniced as lua file. The file was made with notepad because atom remembers last language setting for a file.

Same happens when I create an unique file without extensions with #!/usr/bin/lua in it. The language is recognized.

The only issue is with #!/usr/bin/lua5.1 and #!/usr/bin/lua5.2 and similar.
#!/usr/bin/python2.7 seems to be recognized as python even if there is no file extension.

@pablomayobre
Copy link

The problem is this line the regex is saying that it only matches files with a shebang that ends with lua so lua5.1 or any other thing doesn't match.

The fix would be to replace that regex with \\A#!.*?\\blua(-?(\\d.?\\d)|jit)?\\b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants