Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update project dependencies #1180

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ plugin_version=2.7.3.212.0
kotlin.code.style=official
kotlin_version=1.8.0
junit_version=5.9.2
itangcent_intellij_version=1.7.0
itangcent_intellij_version=1.7.1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class LoggerCollector : AbstractLogger() {

override fun processLog(logData: String?) {
buffer.append(logData)
.appendLine()
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.itangcent.intellij.context.ActionContext
import com.itangcent.intellij.extend.guice.singleton
import com.itangcent.intellij.extend.guice.with
import com.itangcent.intellij.jvm.kotlin.KotlinAutoInject
import com.itangcent.intellij.logger.ConsoleRunnerLogger
import com.itangcent.intellij.logger.IdeaConsoleLogger
import com.itangcent.intellij.logger.LogConfig
import com.itangcent.intellij.logger.Logger
import com.itangcent.intellij.spi.IdeaAutoInject
Expand All @@ -34,11 +34,10 @@ abstract class BasicAnAction : KotlinAnAction {
override fun onBuildActionContext(event: AnActionEvent, builder: ActionContext.ActionContextBuilder) {

super.onBuildActionContext(event, builder)
builder.bindInstance("plugin.name", "easy_api")
builder.bind(LogConfig::class) { it.with(CustomLogConfig::class).singleton() }

builder.bind(Logger::class) { it.with(ConfigurableLogger::class).singleton() }
builder.bind(Logger::class, "delegate.logger") { it.with(ConsoleRunnerLogger::class).singleton() }
builder.bind(Logger::class, "delegate.logger") { it.with(IdeaConsoleLogger::class).singleton() }
builder.bind(ResourceResolver::class) { it.with(CachedResourceResolver::class).singleton() }

afterBuildActionContext(event, builder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ open class SuvApiExporter {
builder: ActionContext.ActionContextBuilder,
) {

builder.bindInstance("plugin.name", "easy_api")

builder.inheritFrom(actionContext, SettingBinder::class)

builder.inheritFrom(actionContext, Logger::class)
Expand All @@ -242,7 +240,7 @@ open class SuvApiExporter {
// builder.bindInstance(Logger::class, BeanWrapperProxies.wrap(Logger::class, actionContext.logger()))

// builder.bind(Logger::class) { it.with(ConfigurableLogger::class).singleton() }
// builder.bind(Logger::class, "delegate.logger") { it.with(ConsoleRunnerLogger::class).singleton() }
// builder.bind(Logger::class, "delegate.logger") { it.with(IdeaConsoleLogger::class).singleton() }

builder.bind(RuleParser::class) { it.with(SuvRuleParser::class).singleton() }
builder.bind(RuleComputeListener::class) { it.with(RuleComputeListenerRegistry::class).singleton() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ abstract class AbstractEasyApiConfigurable(private var myProject: Project?) : Se

val builder = ActionContext.builder()

builder.bindInstance("plugin.name", "easy_api")
myProject?.let { builder.bindInstance(Project::class, it) }
builder.bind(Logger::class) { it.with(SystemLogger::class).singleton() }
builder.bind(LocalFileRepository::class) { it.with(DefaultLocalFileRepository::class).singleton() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ com.itangcent.intellij.spi.IdeaAutoInject
com.itangcent.intellij.tip.OnlyOnceInContextTipSetup
com.itangcent.intellij.jvm.kotlin.KotlinAutoInject
com.itangcent.idea.psi.DisableDocSupport
com.itangcent.suv.http.HttpClientScriptInterceptorSupport
com.itangcent.suv.http.HttpClientScriptInterceptorSupport
com.itangcent.intellij.CustomInfoSupporter
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class LoggerCollectorTest : BaseContextTest() {
fun testLog() {
logger.debug("hello")
logger.info("world")
assertEquals("[DEBUG]\thello${SystemUtils.newLine()}" +
"[INFO]\tworld${SystemUtils.newLine()}", LoggerCollector.getLog())
assertEquals("[DEBUG]\thello\n" +
"[INFO]\tworld\n", LoggerCollector.getLog())
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.itangcent.idea.utils

import com.itangcent.common.utils.SystemUtils
import com.itangcent.debug.LoggerCollector
import com.itangcent.idea.plugin.settings.SettingBinder
import com.itangcent.idea.plugin.settings.Settings
Expand Down Expand Up @@ -31,10 +30,10 @@ internal class ConfigurableLoggerTest : BaseContextTest() {

@ParameterizedTest
@CsvSource(
"EMPTY,[TRACE]\ttrace[DEBUG]\tdebug[INFO]\tinfo[WARN]\twarn[ERROR]\terrorlog",
"LOW,[TRACE]\ttrace[DEBUG]\tdebug[INFO]\tinfo[WARN]\twarn[ERROR]\terrorlog",
"MEDIUM,[INFO]\tinfo[WARN]\twarn[ERROR]\terrorlog",
"HIGH,[ERROR]\terrorlog",
"EMPTY,[TRACE]\ttrace[DEBUG]\tdebug[INFO]\tinfo[WARN]\twarn[ERROR]\terrorlog",
"LOW,[TRACE]\ttrace[DEBUG]\tdebug[INFO]\tinfo[WARN]\twarn[ERROR]\terrorlog",
"MEDIUM,[INFO]\tinfo[WARN]\twarn[ERROR]\terrorlog",
"HIGH,[ERROR]\terrorlog",
)
fun testLog(level: CommonSettingsHelper.CoarseLogLevel, output: String) {
settings.logLevel = level.getLevel()
Expand All @@ -45,6 +44,6 @@ internal class ConfigurableLoggerTest : BaseContextTest() {
logger.warn("warn")
logger.error("error")
logger.log("log")
assertEquals(output, LoggerCollector.getLog().replace(SystemUtils.newLine(), ""))
assertEquals(output, LoggerCollector.getLog().replace("\n", ""))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class KVKitTest {

@Test
fun testForEachValid() {
KV.by("a", "A").forEachValid { t, u ->
KV.of("a", "A").forEachValid { t, u ->
assertEquals("a", t)
assertEquals("A", u)
}

KV.by("", "A").forEachValid { t, u ->
KV.of("", "A").forEachValid { t, u ->
assertEquals("key", t)
assertEquals("A", u)
}
Expand All @@ -29,12 +29,12 @@ class KVKitTest {
assertEquals("A", u)
}

KV.by("a", "A").forEachValid { t, u ->
KV.of("a", "A").forEachValid { t, u ->
assertEquals("a", t)
assertEquals("A", u)
}

KV.by("", "A").forEachValid { t, u ->
KV.of("", "A").forEachValid { t, u ->
assertEquals("key", t)
assertEquals("A", u)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ abstract class PluginContextLightCodeInsightFixtureTestCase : ContextLightCodeIn
override fun bind(builder: ActionContext.ActionContextBuilder) {
builder.bind(SettingBinder::class) { it.with(SettingBinderAdaptor::class) }
builder.bind(RuleParser::class) { it.with(SuvRuleParser::class).singleton() }
builder.bindInstance("plugin.name", "easy_api")
builder.bind(ModuleHelper::class) { it.toInstance(ConstantModuleHelper.INSTANCE) }
builder.bind(MessagesHelper::class) { it.with(EmptyMessagesHelper::class).singleton() }
}
Expand Down
Loading