Skip to content

Commit

Permalink
fix(index): Fix outdated indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
olivernybroe committed Aug 5, 2021
1 parent bed2ee7 commit 4350ebc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## [Unreleased]
### Fixed
- Fixed php type resolving during event dispatching on file listener
- Fixed PSI and index mismatch on file listener

## [1.0.2]
### Fixed
- Fixed indexes being out of date in file listener

## [1.0.1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.pestphp.pest.fileListeners

import com.intellij.openapi.components.service
import com.intellij.openapi.externalSystem.autoimport.AsyncFileChangeListenerBase
import com.intellij.openapi.project.NoAccessDuringPsiEvents
import com.intellij.openapi.project.ProjectManager
import com.intellij.openapi.roots.ProjectFileIndex
import com.intellij.openapi.util.io.FileUtilRt
Expand Down Expand Up @@ -53,10 +54,16 @@ class ExtendAsyncFileListener : AsyncFileChangeListenerBase() {
}
}
} catch (exception: Exception) {
// Ignore up to date stub exceptions
// Ignore up to date stub mismatch exceptions
if (exception.javaClass.simpleName.equals("UpToDateStubIndexMismatch")) {
return
}
if (exception.stackTrace.any { it.methodName.equals("stubTreeAndIndexDoNotMatch") }) {
return
}
if (exception.stackTrace.any { it.className.equals(NoAccessDuringPsiEvents::class.java.name)}) {
return
}

throw exception
}
Expand Down

0 comments on commit 4350ebc

Please sign in to comment.