File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
kotlin-eclipse-ui/src/org/jetbrains/kotlin/ui/builder Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,6 @@ public class KotlinAnalysisJob(
3434 private val affectedFiles : List <IFile >) : Job(" Kotlin Analysis" ) {
3535 init {
3636 setPriority(DECORATE )
37-
38- ProgressIndicatorAndCompilationCanceledStatus .setCompilationCanceledStatus(object : CompilationCanceledStatus {
39- override fun checkCanceled () {
40- if (canceled) throw CompilationCanceledException ()
41- }
42- })
4337 }
4438
4539 val familyIndicator = constructFamilyIndicator(javaProject)
@@ -50,15 +44,21 @@ public class KotlinAnalysisJob(
5044 try {
5145 canceled = false
5246
47+ ProgressIndicatorAndCompilationCanceledStatus .setCompilationCanceledStatus(object : CompilationCanceledStatus {
48+ override fun checkCanceled () {
49+ if (canceled) throw CompilationCanceledException ()
50+ }
51+ })
52+
5353 val analysisResult = KotlinAnalysisProjectCache .getAnalysisResult(javaProject)
5454 val projectFiles = KotlinPsiManager .INSTANCE .getFilesByProject(javaProject.project)
5555 updateLineMarkers(analysisResult.bindingContext.diagnostics, (projectFiles - affectedFiles).toList())
5656
5757 return Status .OK_STATUS
5858 } catch (e: CompilationCanceledException ) {
59- canceled = false
60-
6159 return Status .CANCEL_STATUS
60+ } finally {
61+ ProgressIndicatorAndCompilationCanceledStatus .setCompilationCanceledStatus(null )
6262 }
6363 }
6464
Original file line number Diff line number Diff line change @@ -126,9 +126,8 @@ private fun clearMarkersFromFiles(files: List<IFile>) {
126126}
127127
128128private fun addMarkersToProject (annotations : Map <IFile , List <DiagnosticAnnotation >>, affectedFiles : List <IFile >) {
129- affectedFiles.forEach { DiagnosticAnnotationUtil .INSTANCE .addParsingDiagnosticAnnotations(it, annotations) }
130-
131129 for (file in affectedFiles) {
130+ DiagnosticAnnotationUtil .INSTANCE .addParsingDiagnosticAnnotations(file, annotations)
132131 annotations[file]?.forEach { AnnotationManager .addProblemMarker(it, file) }
133132 }
134133}
You can’t perform that action at this time.
0 commit comments