Skip to content

Commit 5d14acf

Browse files
authored
Remove mentor (#335)
* update mentor structure * testdao * add vertx codegen * remove jvmMain * './gradlew :protocol:build && ./gradlew :protocol:makeExternalJar' working * should be val * './gradlew :protocol:build && ./gradlew :protocol:makeExternalJar && rm -rf protocol/src/jvmMain && git checkout -- protocol/src' is better * './gradlew :protocol:build && ./gradlew :protocol:makeExternalJar && rm -rf protocol/src/jvmMain && git checkout -- protocol/src' no changes * temp hack * switch to jsonMappers * working on discovery * include in maven * service discovery working * services * local tracing test * local tracing test * uniform * remove mentor * local tracing wip * instant marshalling * local tracing wip * local tracing wip * local tracing wip * add log count summary * finish log count indicators added synchronous event listener * todos * merge updates * moved library * fix path * include step * default false * more structured services * remove comments * auto discover services
1 parent 752de34 commit 5d14acf

File tree

79 files changed

+1033
-2029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1033
-2029
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ SourceMarker (alpha) is an APM-powered IDE-based plugin. Inspired by the Feedbac
1919
- Database access metrics
2020
- Integrated distributed trace mapping
2121
- Active exception correlation/tracking
22-
- Operational Advice
23-
- [The Ramp](mentor/src/main/kotlin/com/sourceplusplus/mentor/impl/job/RampDetectionMentor.kt)
2422

2523
## Demonstration
2624

@@ -75,7 +73,6 @@ SourceMarker (alpha) is an APM-powered IDE-based plugin. Inspired by the Feedbac
7573
| ----------------------------- | -------------------------------------------------------------------- | ------- |
7674
| :mapper | Tracks source code artifact refactoring | 0.2.0 |
7775
| :marker | Used to tie visual marks & popups to source code artifacts | 0.2.0 |
78-
| :mentor | Produces source code artifact informative/cautionary advice | 0.2.0 |
7976
| :portal | Used to visually display contextualized artifact data/advice | 0.2.0 |
8077
| :protocol | Common communication data models | 0.2.0 |
8178

config/detekt/detekt.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ style:
2323
active: false
2424
WildcardImport:
2525
active: false
26+
27+
exceptions:
28+
TooGenericExceptionCaught:
29+
active: false

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ kotlin.stdlib.default.dependency = true
2424

2525
mapperVersion = 0.2.0
2626
markerVersion = 0.2.0
27-
mentorVersion = 0.2.0
2827
portalVersion = 0.2.0
2928
protocolVersion = 0.2.0
3029

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/SourceMarkPopupAction.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import com.sourceplusplus.marker.source.SourceFileMarker
1010
import com.sourceplusplus.marker.source.mark.api.ClassSourceMark
1111
import com.sourceplusplus.marker.source.mark.api.MethodSourceMark
1212
import com.sourceplusplus.marker.source.mark.api.SourceMark
13+
import com.sourceplusplus.marker.source.mark.api.event.SourceMarkEvent
14+
import com.sourceplusplus.marker.source.mark.api.event.SourceMarkEventCode
1315
import org.jetbrains.annotations.NotNull
1416

1517
/**
@@ -64,6 +66,8 @@ open class SourceMarkPopupAction : AnAction() {
6466
}
6567

6668
open fun performPopupAction(sourceMark: SourceMark, editor: Editor) {
67-
sourceMark.displayPopup(editor)
69+
sourceMark.triggerEvent(SourceMarkEvent(sourceMark, SourceMarkEventCode.PORTAL_OPENING)) {
70+
sourceMark.displayPopup(editor)
71+
}
6872
}
6973
}

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/api/SourceMark.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import com.sourceplusplus.marker.source.mark.api.config.SourceMarkConfiguration
2626
import com.sourceplusplus.marker.source.mark.api.event.SourceMarkEvent
2727
import com.sourceplusplus.marker.source.mark.api.event.SourceMarkEventCode
2828
import com.sourceplusplus.marker.source.mark.api.event.SourceMarkEventListener
29+
import com.sourceplusplus.marker.source.mark.api.event.SynchronousSourceMarkEventListener
2930
import com.sourceplusplus.marker.source.mark.api.key.SourceKey
3031
import com.sourceplusplus.marker.source.mark.gutter.GutterMark
3132
import com.sourceplusplus.marker.source.mark.inlay.InlayMark
@@ -35,10 +36,8 @@ import org.slf4j.LoggerFactory
3536
import java.awt.event.MouseEvent
3637
import java.awt.event.MouseMotionListener
3738
import java.util.*
38-
import java.util.concurrent.Future
3939
import java.util.concurrent.atomic.AtomicBoolean
4040
import javax.swing.SwingUtilities
41-
import kotlin.collections.ArrayList
4241
import kotlin.concurrent.schedule
4342

4443
/**
@@ -133,8 +132,18 @@ interface SourceMark : JBPopupListener, MouseMotionListener, VisibleAreaListener
133132
fun getEventListeners(): List<SourceMarkEventListener>
134133
fun addEventListener(listener: SourceMarkEventListener)
135134
fun triggerEvent(event: SourceMarkEvent, listen: (() -> Unit)? = null) {
135+
//sync listeners
136+
getEventListeners()
137+
.filterIsInstance<SynchronousSourceMarkEventListener>()
138+
.forEach { it.handleEvent(event) }
139+
140+
//async listeners
136141
GlobalScope.launch {
137-
getEventListeners().forEach { it.handleEvent(event) }
142+
getEventListeners().forEach {
143+
if (it !is SynchronousSourceMarkEventListener) {
144+
it.handleEvent(event)
145+
}
146+
}
138147
listen?.invoke()
139148
}
140149
}

marker/src/main/kotlin/com/sourceplusplus/marker/source/mark/api/event/SourceMarkEventCode.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ enum class SourceMarkEventCode(private val code: Int) : IEventCode {
1313
MARK_ADDED(1000),
1414
MARK_REMOVED(1001),
1515
NAME_CHANGED(1002),
16-
PORTAL_OPENED(1003),
17-
PORTAL_CLOSED(1004);
16+
PORTAL_OPENING(1003),
17+
PORTAL_OPENED(1004),
18+
PORTAL_CLOSED(1005);
1819

1920
override fun code(): Int {
2021
return this.code
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.sourceplusplus.marker.source.mark.api.event
2+
3+
import com.sourceplusplus.marker.source.mark.api.SourceMark
4+
5+
/**
6+
* Used to listen for events produced by [SourceMark]s.
7+
* Calls handleEvent synchronously.
8+
*
9+
* @since 0.2.1
10+
* @author [Brandon Fergerson](mailto:[email protected])
11+
*/
12+
fun interface SynchronousSourceMarkEventListener : SourceMarkEventListener {
13+
override fun handleEvent(event: SourceMarkEvent)
14+
}

mentor/build.gradle.kts

Lines changed: 0 additions & 46 deletions
This file was deleted.

mentor/src/main/kotlin/com/sourceplusplus/mentor/SourceMentor.kt

Lines changed: 0 additions & 210 deletions
This file was deleted.

mentor/src/main/kotlin/com/sourceplusplus/mentor/base/ContextKey.kt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)