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

trivial: add .hack extension for Hack language #4588

Merged
merged 1 commit into from
Aug 12, 2019
Merged

trivial: add .hack extension for Hack language #4588

merged 1 commit into from
Aug 12, 2019

Conversation

jjergus
Copy link
Contributor

@jjergus jjergus commented Jul 23, 2019

.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.

lib/linguist/languages.yml Show resolved Hide resolved
@@ -2003,6 +2003,7 @@ Hack:
codemirror_mode: php
codemirror_mime_type: application/x-httpd-php
extensions:
- ".hack"
- ".hh"
- ".php"
Copy link
Contributor

@ukos-git ukos-git Jul 24, 2019

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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.
@jjergus
Copy link
Contributor Author

jjergus commented Jul 24, 2019

Sample file added.

@lildude lildude merged commit 84cd0eb into github-linguist:master Aug 12, 2019
@jjergus
Copy link
Contributor Author

jjergus commented Aug 12, 2019

Thanks for the review and suggestions!

@lildude lildude mentioned this pull request Nov 18, 2019
3 tasks
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants