Package com.vaadin.base.devserver
Class OpenInCurrentIde
java.lang.Object
com.vaadin.base.devserver.OpenInCurrentIde
Util for opening a file in the currently used IDE.
Supports detecting VS Code, Eclipse and IntelliJ.
- Since:
- 24.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe IDEs that can be detected from the process tree.static final recordThe IDE the application was launched from, and the process it was detected in. -
Method Summary
Modifier and TypeMethodDescriptionGets the IDE and process info for the current process.static voidPrints the process tree the IDE detection works on, to make a detection problem easier to diagnose.static booleanOpens the given file at the given line number in the IDE used to launch the current Java application.
-
Method Details
-
openFile
Opens the given file at the given line number in the IDE used to launch the current Java application.If you are running the Java application from the command line or from an unsupported IDE, then this method does nothing.
- Parameters:
file- the file to openlineNumber- the line number to highlight- Returns:
- true if the file was opened, false otherwise
-
getIdeAndProcessInfo
Gets the IDE and process info for the current process.- Returns:
- the IDE and process info
- Since:
- 24.6.7
-
main
Prints the process tree the IDE detection works on, to make a detection problem easier to diagnose.- Parameters:
args- ignored
-