vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

highlight project class in stacktrace

Open me4405801 opened this issue 4 years ago • 1 comments

Environment

  • Electron: 11.3.0
  • Chrome: 87.0.4280.141
  • Node.js: 12.18.3
  • V8: 8.7.220.31-electron.0
  • OS: Windows_NT x64 6.1.7601(WIN7 SP1)
  • JDK version: openjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
  • Visual Studio Code version: 1.54.1 f30a9b73e8ffc278e71575118b6bf568f04587c8
  • Java extension version: v0.12.1
  • Java Debugger extension version: v0.31.0

i've set the debuger console like this: "java.debug.settings.console": "internalConsole" but all classes just display within stacktrace in same way when error happens

QQ图片20210309100452

i wonder is it possible to highlight class which is in my own project but not in dependencies, just like idea does

idea

by the way,the colorized log setting of a springboot project failed in VSC,but work normaly in idea,this is "logback.xml" setting

3

` public class LogColorConverter extends CompositeConverter<ILoggingEvent> { private static final Map<String, AnsiElement> ELEMENTS;

static {
	Map<String, AnsiElement> ansiElements = new HashMap<>();
	ansiElements.put("faint", AnsiStyle.FAINT);
	ansiElements.put("red", AnsiColor.RED);
	ansiElements.put("green", AnsiColor.GREEN);
	ansiElements.put("yellow", AnsiColor.YELLOW);
	ansiElements.put("blue", AnsiColor.BLUE);
	ansiElements.put("magenta", AnsiColor.MAGENTA);
	ansiElements.put("cyan", AnsiColor.CYAN);
	ELEMENTS = Collections.unmodifiableMap(ansiElements);
}

private static final Map<Integer, AnsiElement> LEVELS;

static {
	Map<Integer, AnsiElement> ansiLevels = new HashMap<>();
	ansiLevels.put(Level.ERROR_INTEGER, AnsiColor.RED);
	ansiLevels.put(Level.WARN_INTEGER, AnsiColor.YELLOW);
	ansiLevels.put(Level.INFO_INTEGER, AnsiColor.BLUE);
	ansiLevels.put(Level.DEBUG_INTEGER, AnsiColor.GREEN);
	LEVELS = Collections.unmodifiableMap(ansiLevels);
}

@Override
protected String transform(ILoggingEvent event, String in) {
	AnsiElement element = ELEMENTS.get(getFirstOption());
	if (element == null) {
		// Assume highlighting
		element = LEVELS.get(event.getLevel().toInteger());
		element = (element != null) ? element : AnsiColor.BLACK;
	}
	return toAnsiString(in, element);
}

protected String toAnsiString(String in, AnsiElement element) {
	return AnsiOutput.toString(element, in);
}

} `

me4405801 avatar Mar 09 '21 02:03 me4405801

Need this

joyous-coder avatar Jun 23 '22 08:06 joyous-coder