Implementing a simple REPL
I'm rather confused about the Console class (and various extensions thereof). What I *want* to do is create a REPL-style console for my Plugin. I already have an object that I can send commands as strings, and whose replies I want to pipe back into a console.
From the documentation, the way to go about doing this seems to be to implement an extension for a ToolWindowFactory, which contains a ConsoleView (or possibly a LanguageConsole?).
- If I register a ToolWindow, it will show up in the general "View->Tool Windows"-menu, but since it's project-specific I would like to put it in a different menu. But I can't figure out how to programatically make the tool window show up (at the bottom of the project window) - any help there?
- I've looked at ConsoleView(Impl) and LanguageConsole(Impl), but the (apparent?) lack of documentation makes things difficult for me. It seems like the print()-method can be used to display text in the terminal, but is there an example for the ConsoleViewContentType-thing? Or a default?
Furthermore - I can't for the life of me figure out how to process user-input. As I said, I already have an object that I would like to pass the user commands (as strings) on to, and I'm pretty sure doing so should be rather simple and I'm just missing the right method/class to implement for that. Can someone point me in the right direction?
Thank you :)
Please sign in to leave a comment.