vscode-kafka
vscode-kafka copied to clipboard
POC with output consumer.
This draft PR replaces the consumer view editor with the vscode standard output channel. Here a little demo:
-
pros for using Output
- performant: don't need to store the whole buffer of the logs. https://github.com/jlandersen/vscode-kafka/blob/e2f0b8f893a0866540ea32b1633100eb54823b63/src/providers/consumerVirtualTextDocumentProvider.ts#L6implements
vscode.TextDocumentContentProvider
which requires to store the full text of the consumer log. When a new log is inserted, the internal buffer is growing up and the text editor is replaced with a large text content although it should just insert at the end the new log text. It causes performance problem too with TextMate syntax highlighting because it highlights the full document instead of applying syntax highlighting only for the inserted log. - provide clean console button out of the box, in other words, it fixes https://github.com/jlandersen/vscode-kafka/issues/40
- provide scroll lock, in other words, it fixes https://github.com/jlandersen/vscode-kafka/issues/44
- provide search feature which I think is very interesting.
- performant: don't need to store the whole buffer of the logs. https://github.com/jlandersen/vscode-kafka/blob/e2f0b8f893a0866540ea32b1633100eb54823b63/src/providers/consumerVirtualTextDocumentProvider.ts#L6implements
-
cons for Output
- we cannot add custom action like start/stop consumer
- when you start several consumer you cannot see them in the same time (with editor you have not this problem).
- syntax highlighting cannot be done for a custom language with a custom TextMate. I mean that Output can be highlighted but for the all output. But it exists an issue for this support in https://github.com/microsoft/vscode/issues/11005 (which is closed but not implemented, I suppose that we need to vote).
@jlandersen @fbricon what do you think about using output instead of using editor (like today) to display Kafka consumer messages?
@angelozerr I originally considered Output first when I implemented consumers but went for the current approach due to specifically not being able to add custom actions as you write.
I am not against adding support for using Output instead, but there should be improvements to managing consumers as well - perhaps a separate node in the sidebar with active consumers (I'd probably want this in the future anyways, regardless of whether consumer output is kept as a text document).
due to specifically not being able to add custom actions as you write.
Ok thanks for your feedback.
I am not against adding support for using Output instead, but there should be improvements to managing consumers as well - perhaps a separate node in the sidebar with active consumers
Ok I will study your idea;
(I'd probably want this in the future anyways, regardless of whether consumer output is kept as a text document).
@jlandersen what do you think about supporting both output and text document with a settings?
due to specifically not being able to add custom actions as you write.
Ok thanks for your feedback.
I am not against adding support for using Output instead, but there should be improvements to managing consumers as well - perhaps a separate node in the sidebar with active consumers
Ok I will study your idea;
(I'd probably want this in the future anyways, regardless of whether consumer output is kept as a text document).
@jlandersen what do you think about supporting both output and text document with a settings?
I'm definitely open for it :)
I'm definitely open for it :)
Thanks for your feedback! @fbricon what do you think about that?
We can do that, but we can go even further. If virtual doc is being used, detect if we reach a buffer threshold and then advise the user to switch to the console