-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
trivial: add .hack extension for Hack language #4588
Conversation
@@ -2003,6 +2003,7 @@ Hack: | |||
codemirror_mode: php | |||
codemirror_mime_type: application/x-httpd-php | |||
extensions: | |||
- ".hack" | |||
- ".hh" | |||
- ".php" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if php
is a deprecated extension and not working anymore anyway with hack, then remove it because we are better of having the extension assigned to plain php.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still very commonly used: https://github.com/search?q=extension%3Aphp+async+await&type=Code
So we should probably not remove it in the near future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jjergus We don't retroactively remove extensions due to declining popularity. If an extension was proven to have enough real-world distribution at the time it was added, that's enough for us.
`.hack` was agreed on as the main extension for Hack files in the future, and is already used by standard Hack libraries (e.g. https://github.com/hhvm/hacktest/tree/master/src) and official documentation (e.g. https://docs.hhvm.com/hack/getting-started/getting-started#your-first-hack-program__3.-write-your-first-hack-program). This should fix syntax highlighting for pull requests such as https://github.com/hhvm/hacktest/pull/84/files For context, `.php` is deprecated for Hack files since the languages are no longer compatible, and `.hh` is discouraged because it can cause confusion with C++ header files.
Sample file added. |
Thanks for the review and suggestions! |
.hack
was agreed on as the main extension for Hack files in the future, and is already used by standard Hack libraries (example) and official documentation (example).This should fix syntax highlighting for pull requests such as https://github.com/hhvm/hacktest/pull/84/files
For context,
.php
is deprecated for Hack files since the languages are no longer compatible, and.hh
is discouraged because it can cause confusion with C++ header files.