This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
Support for HHVM/Hack 3.28, more migrations, as-you-type linting, other improvements
This release supports (and requires) HHVM 3.28
New Features
- add migration to convert PHP stdlib to the HSL
- add add-you-type linting in supported editors
- better diff previews for auto-fixing linters when linting from CLI
- all lint autofixes are now available within supported editors; previously, all lint errors were exposed, but only AST-based lint errors could be fixed within editors
API Changes
EditableList
is nowEditableList<T as EditableNode>
- methods that return
A|B|Missing
now return?EditableNode
; this is to increase consistency, asA|Missing
returns?A
getFile()
now returns aFile
object, including both a path and content. Linters must operate on the content exposed here for as-you-type linting to work correctlyfixLintErrors()
has been removed, replaced withgetFixedFile()
;getFixedFile()
must not edit the file on disk, but should return a newFile
object with modification appliedgetPrettyTextforNode()
no longer takes a$context
parameter; this is rarely used, and requires major usability compromises to the rest of the API. Implementations should store context themselves, or re-calculate it here.FixableLintError
has been removed: anyLintError
is fixable if the linter is anAutoFixingLinter
LSPAutoFixingLinter
has been removed; allAutoFixingLinters
are now fixable via LSP; this is built on top ofgetFixedFile()
andgetTitleForFix()
- Merged
BaseASTLintError
andASTLintError
intoASTLintError
: this distinction was to provide a simpler API for common cases, however the removal ofFixableLintError
and$context
removed all differences.
Other Changes
- removed
--io-log-prefix
option; the situations where it was useful are better served by in-editor logging, or using a wrapper along the lines oftee stdin.log | path/to/real/hhast-lint "$@" 2>stderr.log | tee stdout.log
, as the IO logs only contain output that goes through certain abstractions, rather than all process output. - added
HHAST_LSP_DEBUG
environment variable, which prints various state changes to stderr