GrepConsole icon indicating copy to clipboard operation
GrepConsole copied to clipboard

Feature Request: Provide an open API for other plugins to reuse GrepConsole's capabilities

Open nfzsh opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I am currently developing an open-source plugin for remote log visualization and would like to reuse GrepConsole’s powerful log processing and highlighting capabilities. However, there doesn’t seem to be a way to programmatically leverage these features, such as applying the same highlighting and formatting rules to externally provided log content.

Describe the solution you'd like I would like GrepConsole to provide a public API or interface that allows other plugins to:

Programmatically send log content to GrepConsole. Reuse its existing log processing, highlighting, and formatting rules. Ideally, this API could include methods to:

Input custom log strings into GrepConsole’s pipeline. Retrieve the formatted and highlighted results for display or further processing. Describe alternatives you've considered As an alternative, I considered re-implementing similar log processing and highlighting functionality in my plugin. However, this would duplicate effort and might not align perfectly with GrepConsole’s behavior or configuration options. Reusing GrepConsole’s capabilities would ensure consistency and reduce development time.

Additional context The ability to reuse GrepConsole’s capabilities would expand its ecosystem and allow other developers to integrate it into their plugins for a variety of use cases. I am happy to contribute to this effort if needed.

Thank you for considering this request! My repository: https://github.com/nfzsh/intellij-rancher-plugin/tree/demo Best regards, nfzsh

nfzsh avatar Dec 25 '24 08:12 nfzsh

Sure, no problem, feel free to make a pull request.

It seems that you just want to do:

			Profile selectedProfile = GrepConsoleApplicationComponent.getInstance().getState().getDefaultProfile();
			HighlightingFilter filter = new HighlightingFilter(project, selectedProfile);
			Filter.Result result = filter.applyFilter(text, text.length());

krasa avatar Dec 25 '24 18:12 krasa