scalameta / metals-sublime

Sublime Text package for Metals, a language server for Scala
https://packagecontrol.io/packages/LSP-metals
Apache License 2.0
16 stars 10 forks source link

Clear exiting phantoms when worksheet is being edited #76

Closed ayoub-benali closed 2 years ago

ayoub-benali commented 2 years ago

Worksheets can contain quite a lot of phantoms and it can be messy when several edits are needed. Also the phantoms are obsolete during the edit because the worksheet needs to be re-evaluated anyways. So here we clear the phantoms on the first edit

Peek 2021-12-20 23-02

rchl commented 2 years ago

Personally I think the previous behavior makes more sense.

This is the same case as with diagnostics and you could also argue that everything should be cleared on edit. But we don't do that since that creates an annoying UI behavior with highlights appearing and disappearing frequently.

On editing, the regions are shifted so most of the time those are still valid and at correct positions. And if not, they get updated shortly anyway.