Skip to content

Commit 6d64f35

Browse files
committed
navigation discovery
1 parent 7b50ec5 commit 6d64f35

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

jvm-common/src/main/kotlin/org/digma/intellij/plugin/idea/navigation/JvmEndpointNavigationProvider.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal class JvmEndpointNavigationProvider(private val project: Project) {
4646
methodInfo.endpoints.forEach { endpointInfo ->
4747
val file = fileInfo.file
4848
val endpointLocation = EndpointLocation(file, endpointInfo.id, endpointInfo.offset, methodId)
49-
Log.trace(logger, "adding endpoint location for {} endpoint {}", file.url, endpointLocation.endpointId)
49+
Log.trace(logger, project, "adding endpoint location for {} endpoint {}", file.url, endpointLocation.endpointId)
5050
val methods = endpointsMap.computeIfAbsent(endpointLocation.endpointId) { CopyOnWriteArraySet() }
5151
methods.add(endpointLocation)
5252
}
@@ -61,9 +61,9 @@ internal class JvmEndpointNavigationProvider(private val project: Project) {
6161

6262
suspend fun maintenance() {
6363

64-
Log.trace(logger, "starting maintenance, current endpoint location count {}", endpointsMap.size)
64+
Log.trace(logger, project, "starting maintenance, current endpoint location count {}", endpointsMap.size)
6565
if (logger.isTraceEnabled) {
66-
Log.trace(logger, "endpoint locations {}", endpointsMap.entries.joinToString(", ") { "[${it.key} -> ${it.value}]" })
66+
Log.trace(logger, project, "endpoint locations {}", endpointsMap.entries.joinToString(", ") { "[${it.key} -> ${it.value}]" })
6767
}
6868

6969
maintenanceLock.withLock {
@@ -73,7 +73,7 @@ internal class JvmEndpointNavigationProvider(private val project: Project) {
7373
if (toRemove.isEmpty()) {
7474
return@withLock
7575
}
76-
Log.trace(logger, "maintenance removing endpoints {}", toRemove)
76+
Log.trace(logger, project, "maintenance removing endpoints {}", toRemove)
7777
endpointsMap.entries.removeIf { toRemove.contains(it.key) }
7878
}
7979
}

jvm-common/src/main/kotlin/org/digma/intellij/plugin/idea/navigation/JvmSpanNavigationProvider.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal class JvmSpanNavigationProvider(private val project: Project) {
4949

5050

5151
suspend fun processCandidateFile(fileInfo: FileDiscoveryInfo) {
52-
Log.trace(logger, "processing candidateFile {}", fileInfo.file.url)
52+
Log.trace(logger, project,"processing candidateFile {}", fileInfo.file.url)
5353
maintenanceLock.withLock {
5454

5555
removeEntriesForFile(fileInfo.file)
@@ -58,7 +58,7 @@ internal class JvmSpanNavigationProvider(private val project: Project) {
5858
methodInfo.spans.forEach { spanInfo ->
5959
val file = fileInfo.file
6060
val spanLocation = SpanLocation(file, spanInfo.offset, methodId)
61-
Log.trace(logger, "adding span location for {} span {}", file.url, spanInfo.id)
61+
Log.trace(logger, project,"adding span location for {} span {}", file.url, spanInfo.id)
6262
spanLocations[spanInfo.id] = spanLocation
6363
}
6464
}
@@ -71,17 +71,17 @@ internal class JvmSpanNavigationProvider(private val project: Project) {
7171

7272
suspend fun maintenance() {
7373

74-
Log.trace(logger, "starting maintenance, current span location count {}", spanLocations.size)
74+
Log.trace(logger, project,"starting maintenance, current span location count {}", spanLocations.size)
7575
if(logger.isTraceEnabled){
76-
Log.trace(logger, "span locations {}", spanLocations.entries.joinToString(", ") { "[${it.key} -> ${it.value}]" })
76+
Log.trace(logger, project,"span locations {}", spanLocations.entries.joinToString(", ") { "[${it.key} -> ${it.value}]" })
7777
}
7878

7979
maintenanceLock.withLock {
8080
val toRemove = spanLocations.filter { (_, spanLocation) -> !spanLocation.isAlive() || !hasIndex(project, spanLocation.file) }.keys
8181
if (toRemove.isEmpty()) {
8282
return@withLock
8383
}
84-
Log.trace(logger, "maintenance removing spans {}", toRemove)
84+
Log.trace(logger, project,"maintenance removing spans {}", toRemove)
8585
spanLocations.entries.removeIf { toRemove.contains(it.key) }
8686
}
8787
}

0 commit comments

Comments
 (0)