breeze2 / vscode-phpstan

Visual Studio Code extension working with phpstan
MIT License
22 stars 8 forks source link

File is analysed multiple times #14

Open Vaggal opened 4 years ago

Vaggal commented 4 years ago

Hello, I have noticed that the analysis of a php file happens multiple times when you open it for the first time or make changes to it.

After some checking it seems that the double checking is triggered by the double fire of the onDidOpenTextDocument event. It seems that it is up to the extension to handle it properly. The issue onDidOpenTextDocument event is missing event information contains some workarounds for this.

mindplay-dk commented 3 years ago

A screen capture to illustrate the problem:

inspection-bug

In conjunction with #15, this is quite distracting - fixing that should probably take priority over this issue, since you wouldn't even know this issue existed then.

mindplay-dk commented 3 years ago

For the record, I also tested Calvin Baart's extension (as well as this fork) which does not have either of these problems - might be able to reference it for how to trigger and update inspection results to fix both of these issues. (Unforunately, that extension doesn't update when you edit a file - you have to save to trigger an update, which makes it pretty useless to me...)