jlandersen / vscode-kafka

Apache Kafka® extension for Visual Studio Code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Produce-record command

omerd-cyera opened this issue · comments

Love the extension!
I think it would be great if you could have a bind to "produce message".
Its pretty limiting to have to use the mouse to send a preConfigured message.

If you could send a message when the mouse is inside a block (like below) it could be great

PRODUCER json-output
topic: my.topic
{
  "a": "a"
}
###

are you accepting PRs?

@od-cyera sure, have at it!

@od-cyera many thanks for your great contribution. I review it and it should be nice if you could follow my idea to avoid parsing the full kafka file, loop for each block to retrieve the proper block an dexecuting codelens services to get just the proper command.

Hope you will keep your motivation to do that, but I think we must try to have good performance.

I wonder too if we should activate the highlight to higlight the selected block. I think it can be helpfull to know quickly which block will be executed. @fbricon @od-cyera what do you think about that?

Thank you for the great extension :)
I hope I Fixed what you meant, let me know if not.

When running a consumer, Its pretty plane to see the action taking place (window opens, lens text change).
But i do agree some indication would be nice for produce blocks both for inline activation and when pressing the lens button.

Thank you for the great extension :)

Thanks! Glad you like it andglad you contribute it.

I hope I Fixed what you meant, let me know if not.

Thanks for your fix, it is almost the thing that I had in my mind. The only thing that I would like to avoid is to have TypeScript file in services folder which are not a service (ex : completion, hover, codelens, etc).

The main idea is to

  • remove your new files (common.ts, producer.ts and consumer.ts)
  • defines for each block (ConsumerBlock, ProducerBlock AST a method which create the command).

I tried to review that.

I agree, added the new fixes.

Are you thinking of pushing an extension update for this pr? or are there other things in progress that will be merged into the same update?.