Skip to content

Commit ce2ab5d

Browse files
author
Offensive 360
committed
Fix VS path resolution at Log time (not just nav), strip zip prefix from Document. Remove AS cache loading from factory (freeze fix).
1 parent ed0dfc7 commit ce2ab5d

2 files changed

Lines changed: 1 addition & 24 deletions

File tree

src/main/kotlin/com/offensive360/sast/toolwindow/SecurityFindingsToolWindowFactory.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,12 @@ import com.intellij.openapi.project.Project
44
import com.intellij.openapi.wm.ToolWindow
55
import com.intellij.openapi.wm.ToolWindowFactory
66
import com.intellij.ui.content.ContentFactory
7-
import com.offensive360.sast.util.ScanCache
87

98
class SecurityFindingsToolWindowFactory : ToolWindowFactory {
109
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
1110
val panel = SecurityFindingsPanel(project)
1211
val content = ContentFactory.getInstance().createContent(panel.component, "", false)
1312
toolWindow.contentManager.addContent(content)
1413
SecurityFindingsService.getInstance(project).toolWindowPanel = panel
15-
16-
// Load cached results on background thread to avoid freezing the UI
17-
val projectBasePath = project.basePath
18-
if (projectBasePath != null) {
19-
com.intellij.openapi.application.ApplicationManager.getApplication().executeOnPooledThread {
20-
try {
21-
val cached = ScanCache.load(projectBasePath)
22-
if (cached != null && cached.findings.isNotEmpty()) {
23-
val cachedFiles = cached.fileHashes.keys.map { java.io.File(it) }
24-
val currentHashes = ScanCache.computeFileHashes(cachedFiles)
25-
com.intellij.openapi.application.ApplicationManager.getApplication().invokeLater {
26-
if (ScanCache.hasFilesChanged(currentHashes, cached.fileHashes)) {
27-
panel.setStatus("Code has changed since last scan. Run a new scan for updated results.")
28-
} else {
29-
panel.showFindings(cached.findings)
30-
panel.setStatus("Showing ${cached.findings.size} cached finding${if (cached.findings.size != 1) "s" else ""} from previous scan")
31-
}
32-
}
33-
}
34-
} catch (_: Exception) { }
35-
}
36-
}
3714
}
3815
}

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<!-- Tool window -->
4242
<toolWindow
4343
id="O360 Security Findings"
44-
secondary="false"
44+
secondary="true"
4545
icon="/icons/logo.svg"
4646
anchor="bottom"
4747
canCloseContents="true" factoryClass="com.offensive360.sast.toolwindow.SecurityFindingsToolWindowFactory"/>

0 commit comments

Comments
 (0)