Skip to content

Commit

Permalink
Added new config option for java debugger instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
swesteme committed Aug 16, 2024
1 parent 84d02bc commit 9dfea77
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import com.intellij.compiler.CompilerConfiguration;
import com.intellij.compiler.CompilerConfigurationImpl;
import com.intellij.compiler.impl.javaCompiler.BackendCompiler;
import com.intellij.debugger.settings.DebuggerSettings;
import com.intellij.openapi.project.Project;
import de.gebit.plugins.autoconfig.UpdateHandler;
import de.gebit.plugins.autoconfig.handlers.AbstractHandler;
import de.gebit.plugins.autoconfig.model.AnnotationProcessor;
import de.gebit.plugins.autoconfig.model.Compiler;
import de.gebit.plugins.autoconfig.model.JavaConfiguration;
import de.gebit.plugins.autoconfig.model.*;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.jps.model.java.compiler.ProcessorConfigProfile;

Expand Down Expand Up @@ -81,6 +81,17 @@ public List<String> updateConfiguration(JavaConfiguration configuration, Project
applySetting(buildProcessHeapSize, compilerConfiguration.getBuildProcessHeapSize(0), compilerConfiguration::setBuildProcessHeapSize, changedConfigs, "Build process heap size");
}
}

Debugger debugger = configuration.getDebugger();
if (debugger != null) {
AsyncStackTraces asyncStackTraces = debugger.getAsyncStackTraces();
if (asyncStackTraces != null) {
applySetting(asyncStackTraces.getUseInstrumentingAgent(),
DebuggerSettings.getInstance().INSTRUMENTING_AGENT,
v -> DebuggerSettings.getInstance().INSTRUMENTING_AGENT = v, changedConfigs,
"Use instrumenting agent (application setting)");
}
}
return changedConfigs;
}
}
16 changes: 16 additions & 0 deletions src/main/resources/schema/java.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@
"title": "Java configuration",
"type": "object",
"properties": {
"debugger": {
"type": "object",
"description": "Debugger settings",
"properties": {
"asyncStackTraces": {
"description": "Settings for async stack traces",
"type": "object",
"properties": {
"useInstrumentingAgent": {
"type": "boolean",
"description": "Whether instrumenting agent should be used (application wide setting!)"
}
}
}
}
},
"compiler": {
"type": "object",
"description": "Compiler settings",
Expand Down

0 comments on commit 9dfea77

Please sign in to comment.