-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple projects simultaneously (#789)
* fix: sourceplusplus/sourceplusplus#475 * refactor: use intellij logging * remove plugin debug console * gracefully handle config with removed settings * fix: reload compiled live plugins on project reset * fix: already disposed IncorrectOperationException * refactor: get live services from project refactor: get service discovery backend from project * fix: npe * refactor: get live status manager from project * fix check * unused
- Loading branch information
1 parent
7cd752b
commit 0810501
Showing
73 changed files
with
456 additions
and
686 deletions.
There are no files selected for viewing
Submodule commander
updated
20 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,13 @@ package spp.jetbrains.marker | |
import com.google.common.collect.ImmutableList | ||
import com.google.common.collect.Lists | ||
import com.google.common.collect.Maps | ||
import com.intellij.openapi.diagnostic.logger | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.util.Key | ||
import com.intellij.psi.PsiFile | ||
import io.vertx.core.Vertx | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
import org.slf4j.LoggerFactory | ||
import spp.jetbrains.marker.impl.ArtifactNamingService | ||
import spp.jetbrains.marker.impl.SourceGuideProvider | ||
import spp.jetbrains.marker.source.SourceFileMarker | ||
|
@@ -39,14 +42,28 @@ import spp.protocol.artifact.ArtifactType | |
* @author [Brandon Fergerson](mailto:[email protected]) | ||
*/ | ||
@Suppress("TooManyFunctions") | ||
object SourceMarker { | ||
class SourceMarker { | ||
|
||
var PLUGIN_NAME = "SourceMarker" | ||
companion object { | ||
var PLUGIN_NAME = "SourceMarker" | ||
|
||
private val log = logger<SourceMarker>() | ||
private val KEY = Key.create<SourceMarker>("SPP_SOURCE_MARKER") | ||
val VERTX_KEY = Key.create<Vertx>("SPP_VERTX") | ||
|
||
@Synchronized | ||
fun getInstance(project: Project): SourceMarker { | ||
if (project.getUserData(KEY) == null) { | ||
val sourceMarker = SourceMarker() | ||
project.putUserData(KEY, sourceMarker) | ||
} | ||
return project.getUserData(KEY)!! | ||
} | ||
} | ||
|
||
@Volatile | ||
var enabled = true | ||
val configuration: SourceMarkerConfiguration = SourceMarkerConfiguration() | ||
private val log = LoggerFactory.getLogger(javaClass) | ||
private val availableSourceFileMarkers = Maps.newConcurrentMap<Int, SourceFileMarker>() | ||
private val globalSourceMarkEventListeners = Lists.newArrayList<SourceMarkEventListener>() | ||
|
||
|
@@ -65,7 +82,7 @@ object SourceMarker { | |
if (availableSourceFileMarkers.remove(sourceFileMarker.hashCode()) != null) { | ||
sourceFileMarker.clearSourceMarks() | ||
sourceFileMarker.psiFile.putUserData(SourceFileMarker.KEY, null) | ||
log.info("Deactivated source file marker: {}", sourceFileMarker) | ||
log.info("Deactivated source file marker: $sourceFileMarker") | ||
return true | ||
} | ||
return false | ||
|
@@ -120,12 +137,12 @@ object SourceMarker { | |
} | ||
|
||
fun addGlobalSourceMarkEventListener(sourceMarkEventListener: SourceMarkEventListener) { | ||
log.info("Adding global source mark event listener: {}", sourceMarkEventListener) | ||
log.info("Adding global source mark event listener: $sourceMarkEventListener") | ||
globalSourceMarkEventListeners.add(sourceMarkEventListener) | ||
} | ||
|
||
fun removeGlobalSourceMarkEventListener(sourceMarkEventListener: SourceMarkEventListener) { | ||
log.info("Removing global source mark event listener: {}", sourceMarkEventListener) | ||
log.info("Removing global source mark event listener: $sourceMarkEventListener") | ||
globalSourceMarkEventListeners.remove(sourceMarkEventListener) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.