This extension adds rich Hack language & HHVM support to Visual Studio Code. Visit http://hacklang.org to get started with Hack.
It is published in the Visual Studio Marketplace here. To install, search for "Hack" in the VS Code extensions tab or run the following command (⌘+P): ext install vscode-hack
.
- Added Code Actions to automatically suppress typechecker errors via HH_FIXME comments.
- Fixed document symbol outline (⇧⌘O) break in newer hh_client versions.
- Added a new setting to enable type coverage checking (now off by default).
- Updated Hack grammar for better syntax highlighting.
- Lots of performance improvements, mainly by refactoring the codebase to use async/await.
- Works best with HHVM 3.18 or later.
Please see the full list of recent releases and features added on the Github releases page.
- Type Checking
- Autocomplete
- Hover Hints
- Document Symbol Outline
- Workspace Symbol Search
- Document Formatting
- Go To/Peek Definition
- Find All References
- Hack Coverage Check
This extension is supported on Linux and Mac OS X 10.10 onwards (see HHVM compatibility). The latest versions of Hack typechecking tools (hh_client
and hh_server
) are required on the local machine. The workspace should have a .hhconfig
file at its root.
This extension adds the following Visual Studio Code settings. These can be set in user preferences (⌘+,) or workspace settings (.vscode/settings.json
).
hack.clientPath
: Absolute path to thehh_client
executable. This can be left empty ifhh_client
is already in your environment $PATH.hack.enableCoverageCheck
: Enable calculation of Hack type coverage percentage for every file and display in status bar (default:false
).hack.useDocker
: Bypass local hhClient by using a Docker container for hh_client support (default:false
).hack.dockerSourcePath
: Source code path inside docker container (default:null
).hack.dockerContainerName
: Name of docker container where hh_client is installed (default:null
).
Please file all bugs, issues, feature requests etc. at the GitHub issues page.
Current known issues:
- (#1, Microsoft/vscode#10915) The editor may not select the Hack language mode for
.php
files even if they start with<?hh
. To get around this, either manually select "Hack" as the file language from the selector on the bottom right of the screen, or configure your project workspace to open all.php
files in Hack mode by adding the following to your workspace settings:
"files.associations": {
"*.php": "hack"
}
There are lots of ways to help! You can file new bugs and feature requests, or fix a pending one. To contribute to the source code, fork the repository on GitHub and create a pull request. Check out the VS Code extension development guide to get started.
The source code for this extension is hosted at https://github.com/PranayAgarwal/vscode-hack and is available under the MIT license.