slackhq / vscode-hack

Hack language & HHVM debugger support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pranayagarwal.vscode-hack
MIT License
73 stars 36 forks source link

Add Hack Error suppression to LSP mode #111

Closed yucombinator closed 3 years ago

yucombinator commented 3 years ago

Add a code action to allow hack errors to be quickly FIXME'ed.

The code for the error suppression quickfix was already part of the plugin for legacy (non-LSP) mode, but it stopped working in LSP mdoe as the hack LSP server does not support quick fixes, so this PR restores the old behavior by adding the code actions.

Wilfred commented 3 years ago

Interesting, we don't have a corresponding facility in our IDE integration. When do you find this useful? HH_FIXME is usually a code smell.

yucombinator commented 3 years ago

It comes in handy as we have a fair number of legacy code that needs to be FIXME'd when we need to upgrade hHVM versions, and eliminating the FIXME's would be too big in scope and will be dealt with later.

Another Code Action that would be useful to add (that I'm looking into on my free time), is the possibility of creating auto complete suggestions for unbound symbol names and leveraging hh_client --search. This could be useful for example, to create suggest namespace auto-completion. Would these be a use for that as well?

fredemmott commented 3 years ago

For the upgrade case, would bin/hhast-migrate --add-fixmes be a better approach? It's also strongly discouraged, but lets you do the whole codebase in one go, and avoids promoting FIXMEs via IDE features

Wilfred commented 3 years ago

Regarding unbound symbol names, that sounds interesting! If you fancy opening a separate issue, I'd love to learn more.

yucombinator commented 3 years ago

Sure I'll make an issue once I get a working prototype or something going 👍