From f7faed8e07df4c9552708f2c404afd7960ba0327 Mon Sep 17 00:00:00 2001 From: angelozerr Date: Tue, 2 Feb 2021 22:09:07 +0100 Subject: [PATCH] Provide an option to clear the consumer view Fixes #40 Signed-off-by: azerr --- CHANGELOG.md | 1 + docs/Consuming.md | 32 +++++++++- docs/assets/consumer-view.png | Bin 0 -> 13872 bytes docs/assets/start-consumer-from-command.png | Bin 0 -> 6769 bytes docs/assets/start-consumer-from-explorer.png | Bin 0 -> 17189 bytes images/dark/clear-all.svg | 1 + images/light/clear-all.svg | 1 + package.json | 15 +++++ src/commands/consumers.ts | 41 +++++++++--- src/extension.ts | 12 +++- .../consumerVirtualTextDocumentProvider.ts | 60 +++++++++++------- 11 files changed, 127 insertions(+), 36 deletions(-) create mode 100644 docs/assets/consumer-view.png create mode 100644 docs/assets/start-consumer-from-command.png create mode 100644 docs/assets/start-consumer-from-explorer.png create mode 100644 images/dark/clear-all.svg create mode 100644 images/light/clear-all.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 15ccdb0..bfae418 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to Kafka extension will be documented in this file. - Selected Cluster or Topic can now be deleted via the Delete shortcut (Cmd+Backspace on Mac). See [#79](https://github.com/jlandersen/vscode-kafka/issues/79) - Added SASL/SCRAM-256 and SASL/SCRAM-512 authentication support. See [#3](https://github.com/jlandersen/vscode-kafka/issues/3). - Added the option to enable basic SSL support for clusters without authentication. See [#84](https://github.com/jlandersen/vscode-kafka/issues/84). +- The consumer view now provides a `Clear Consumer View` command. See [#84](https://github.com/jlandersen/vscode-kafka/issues/40). ### Changed - Improved the "New cluster" and "New topic" wizards: now include validation and a back button. See [#21](https://github.com/jlandersen/vscode-kafka/issues/21). diff --git a/docs/Consuming.md b/docs/Consuming.md index d278bf8..911e97d 100644 --- a/docs/Consuming.md +++ b/docs/Consuming.md @@ -1,10 +1,40 @@ # Consuming messages -Consuming topics can be done by right clicking a topic in the explorer or from the command palette. Some things to note about consuming: +Consuming topics can be done: + +* with [Kafka Explorer](#kafka-explorer) by right clicking a topic in the explorer. +* with the [Start command](#start-command) from the command palette. + +Some things to note about consuming: * UTF-8 encoded keys and values only. If data is encoded differently, it will not be pretty. * One consumer group is created per topic (may change in the future to just have one for the extension). +## Consume with ... + +### Kafka explorer + +You can start consumer with [Kafka Explorer](Explorer.md#explorer) by right clicking a topic in the explorer: + +![Start Consumer with Explorer](assets/start-consumer-from-explorer.png) + +In this case, you cannot configure offset, partition and consumer group id name. The offset can be just configured with the [kafka.consumers.offset](#kafkaconsumersoffset) preference. + +### Start command + +![Start Consumer with palette](assets/start-consumer-from-command.png) + +## Consumer View + +When consumer is started, it opens a read-only editor which shows producing messages: + +![Consumer view](assets/consumer-view.png) + +This editor provides 2 commands on the right of the editor: + + * `Clear Consumer View` to clear the content of the view. + * `Start/Stop` to stop or restart the consumer. + Consumers are based on virtual documents, available in the VS Code extension API. A consumer will keep running even if you close the document in the editor. You should make sure to close the consumer explicitly, either via the command palette, the status bar element or the start/stop action button as well. The VS Code API does not support detecting if a virtual document is closed immediately. Instead, the underlying virtual document is automatically closed after two minutes if the document is closed in the editor. ## Preferences diff --git a/docs/assets/consumer-view.png b/docs/assets/consumer-view.png new file mode 100644 index 0000000000000000000000000000000000000000..ee0c2b7f6a8791ff6820a498624ad0843f796c38 GIT binary patch literal 13872 zcmch8XIN9+wr-H#K?H;ds0b=mAOsa@0-+h{ND(mf5*-{_x`y&4~wjowdR~_jxopkj(1Fg)SfF)Q?OEiKp<)*ML7)+ z=*k@sh#-aR3UDQ&D|!t0L*S^P@D!Bab7L7eA+nT#%YZo*c+&UB4o*7W31Q!W^hbbzCyD(9GR^yX?82SMw zH}XkXHv-f0&?xsfPQzYmqE=$!&}$)fV|lYq&u^?^t*Fx)!kYJD zy=`}Q>u6Cm!F~B|LHxz?D)Y40>bmRn2@66~c8XawrQb>(+K_JSX8Z&NOJT&5p?!XO zZ$Vg5I%b^6WB-HZK`V%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w zO(LHbN~+ynA&74O(Y!F;*)dT4$ll1d!|gj zQ}oSyJvR66-gb_V-?Po8jf}G{EuA(J~Ld`FuO zlRza=G?Lq8P>|kl@BY+jgXg(2Jrq#LOp88_oUtM_GrwWf>j;)O{4g@MK)^`9qwggF zHZ)IUZYK8NfQHmw_yaoK5oX6P*60&_;>anN9%?;l+(L%dX@s4TU@U8lXzygJ;o81h zd0?&rHS1UUVI8<{Ya|5t{!SHcAKRvPzM}GmCPxi~+i6r(Lbv;68HRU{NxUUsWiG7( z26ru(n3#ZkrFo+*^kixnWlQ2QVft87w0F*Vb;b3!#bk2)&0wgw+iq99y^T*VQ|zZ5 z0n4;ueOh+!8s)MUT+hm`>_k%uXp^N0BB#c{T5H zSA+^NuO9BY5+}IC$WV`5m-FhGJ_P%*3|p1?HYct+oa_3Ktg?s_SXB9X^fifswLk^# zR{6Su$Hv3VIqZW5R5x|K z%{>h*HE?nxVzY3KLQB`P_|OLKw+s6jhf?W|lHp-kT0kfpV?6>kWSC{0VBAl)TIHv9 zA0mfXJz3#~llOTX{yz&|lL6iJA4x4OEj#I;5@_8VTpJ8y()co!Jk<~NI5FPLQ6GvJ z#J9m*i?$GRPJ?eP#qJDn`Jq^;<|li+@Bd1zYTnh^{7}aM-56%8DG8~E(_A(Sp41G7e=o8AcRk!oN|3b6Y~#W-0q9HIlq$d8aU+Oh;J>^;O7hR;@}Iu?@V@}l6~0dZ literal 0 HcmV?d00001 diff --git a/docs/assets/start-consumer-from-command.png b/docs/assets/start-consumer-from-command.png new file mode 100644 index 0000000000000000000000000000000000000000..d388a171f0fa223532ccc0a497d237866ee88103 GIT binary patch literal 6769 zcmbt&c{tnK*KgFR8XDCJML8XHFcw7(X{Dt)Y3o$YL6o#1I6+L2wurW-w#FLkhti71 z6tl#fIz^~TR76@@Q^XXa5|KBYd*A1||J?UJ&;29WYp?0M_S(~D?dP{|SplV$qyYc` z(E94-y8wVVP(;6wlo0(-H@!P7YQ&ItttGidPW^g3Kfl@ivoG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-=!M}^Z=3z{GcQaVwsTT;gKXxl}+)1?^5vP6+lg-cXRXZBdUp~_D zXuAZ(84KUHkwKdQdU7|~cFC%l;*f6j+en<6A`EoPw2{aD28>5N3%aFIz#kQgAMkX0 Vd*M~tt*t<;uiU!)(ZcQNe*wVG9f$w` literal 0 HcmV?d00001 diff --git a/docs/assets/start-consumer-from-explorer.png b/docs/assets/start-consumer-from-explorer.png new file mode 100644 index 0000000000000000000000000000000000000000..f037ed89d1779eae5723378328562c987885938e GIT binary patch literal 17189 zcmc({XH-*Rv?d%YVneAa0*a8(5k!a(!Gd5Yq4%Z~F+#x5dsI{)p$MS}1WR8 z=m`9#rZEV#8vz3Cx_n?i@Dn!23~txB0d#|vg(cXs1!>f zmy4O~YRM*Eu}*(f`R(H;F@Eq3v^#n)Zeh^1P+UBI_YI>{4=W?hLSFq1OEtpkI(k9?%u- z%6ELAHBRPU(5HC!`}-b*J%a86`G^VH?s}2+f8(n*bkf#Z3(g>H&V&Y0XK_WeP}Gw! z*3RM5pamW(C+Oblv@51AV6n%7(V+j9Ix#)aDL`4YaedlCiBGnG8d+=3(~!7ysw22b9oV_Y#~ZI@D(6$eW8enj48-O{Kyc{=8qNZ;WiTkLWlN zAN_|{uE?f~A*^q7-RsI?517z~JRM3tB#b+3O=ZPo1+GQVNbJE0*!j#OWuQ+62z>&% zcFPaFFtctqI7*ZDq}VkyZoSeKoO|Mm%elQK9rwCAVIAih_jJt6^}P{mT7cLQ#=2;+ zIX|MV+Uh?s*)pWv$)Dwqyb$QFQLU!QmSeb9$9FG|D~H;_M%{iqmrAFS5>GmG>YSXi zNfyxH>PITyAS`^U%Y~P~!8b9B78o?{q@|{qYZ%d`) zxREqs)T^hV0=5=#foZVVav@2DyQW&B9Pf^WB7+fJnDjI7=VHcL8$VhvAQGe+`}i}c z@ZEVq1uWNtJCW9EO-1S`gYPnXHOu-WRAgyIAz8S1^OxNbUKgcMl&AaAiUTJWrH{YQ zEnB=k>y0iJpchR&qmrluT|%?8@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-#)vtwa+uv7Tsdbu~4nA<5l>@CQ z;wUfe9v)$>p94%^HDg-#ejpE_CQ-ZTfQrS&`#2CcN8Hn)$Sdv1zho~TeI?(xV7#g> zNUdr7IePa~*i20yxMkqMaK7-{+U#{zEPi<2cZ60ua!DwswxK_xbr+p>dZ8$R9~?~P403(w-(kPI{b4pb6L$5NsjFl zP|t^3r3X!EbyY_~+p8`L0EegdEf~iGdRzMfr3`=OTo?nDt#A9W{qvpSolq2B^X9L{ zO*h`wcx}f#7+V979k(9>PT&5W1NIyW$MO#cr3-9tZ728qKRk~+hkHEP#$)>)e;J?c zGk=S@04T{`t$d2uHt7bCGW;I%pw~Va62dOZ?g4??0lU;52|$L*-msU{o;qv}MTEaa zIe9#h1rDeO=z$3nm~YB#(|pJlBR@dpL1KFLX$!b*KkOkyGFponH#60h?uZ$c3*9}&@qp2!%RqWCwg;yAnt_TB z6{8-_Tn&eUh{BW`zw-bBtN(Zd>?GKz{Bl3&D5xNUlY!L119taDx0(pq7vH+T+5-g< zgj4&8r+_7{f5_#m4R^o7@u25f>qq2&k*IGw{J;Gt9nSglZfRVdP0)>%rmk)OtqAxH Lgl5^bTaW$+T!Mh1 literal 0 HcmV?d00001 diff --git a/images/dark/clear-all.svg b/images/dark/clear-all.svg new file mode 100644 index 0000000..316bbe2 --- /dev/null +++ b/images/dark/clear-all.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/light/clear-all.svg b/images/light/clear-all.svg new file mode 100644 index 0000000..3bb24db --- /dev/null +++ b/images/light/clear-all.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/package.json b/package.json index ced50e7..ae2aa9d 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "onCommand:vscode-kafka.consumer.consume", "onCommand:vscode-kafka.consumer.list", "onCommand:vscode-kafka.consumer.toggle", + "onCommand:vscode-kafka.consumer.clear", "onCommand:vscode-kafka.explorer.copylabel", "onCommand:vscode-kafka.explorer.deleteselected", "onView:kafkaExplorer", @@ -270,6 +271,15 @@ "light": "images/light/toggle.svg", "dark": "images/dark/toggle.svg" } + }, + { + "command": "vscode-kafka.consumer.clear", + "title": "Clear Consumer View", + "category": "Kafka", + "icon": { + "light": "images/light/clear-all.svg", + "dark": "images/dark/clear-all.svg" + } } ], "menus": { @@ -337,6 +347,11 @@ "command": "vscode-kafka.consumer.toggle", "group": "navigation", "when": "resourceScheme == kafka" + }, + { + "command": "vscode-kafka.consumer.clear", + "group": "navigation", + "when": "resourceScheme == kafka" } ] }, diff --git a/src/commands/consumers.ts b/src/commands/consumers.ts index 9204721..7da8b81 100644 --- a/src/commands/consumers.ts +++ b/src/commands/consumers.ts @@ -5,6 +5,7 @@ import { pickTopic } from "./common"; import { ClusterSettings } from "../settings"; import { CommonMessages } from "../constants"; import { KafkaExplorer } from "../explorer"; +import { ConsumerVirtualTextDocumentProvider } from "../providers"; export interface StartConsumerCommand { clusterId: string; @@ -17,7 +18,7 @@ export class StartConsumerCommandHandler { private clusterSettings: ClusterSettings, private consumerCollection: ConsumerCollection, private explorer: KafkaExplorer - ) { + ) { } async execute(startConsumerCommand?: StartConsumerCommand): Promise { @@ -55,6 +56,9 @@ export class StartConsumerCommandHandler { } export class ToggleConsumerCommandHandler { + + public static COMMAND_ID = 'vscode-kafka.consumer.toggle'; + constructor(private consumerCollection: ConsumerCollection) { } @@ -75,6 +79,25 @@ export class ToggleConsumerCommandHandler { } } } +export class ClearConsumerViewCommandHandler { + + public static COMMAND_ID = 'vscode-kafka.consumer.clear'; + + constructor(private provider: ConsumerVirtualTextDocumentProvider) { + + } + async execute(): Promise { + if (!vscode.window.activeTextEditor) { + return; + } + + const { document } = vscode.window.activeTextEditor; + if (document.uri.scheme !== "kafka") { + return; + } + this.provider.clear(document); + } +} enum ConsumerOption { Open, @@ -144,7 +167,7 @@ async function openDocument(uri: vscode.Uri): Promise { // If there's no document we open it if (!document) { - document = await vscode.workspace.openTextDocument(uri); + document = await vscode.workspace.openTextDocument(uri); } // Check if there's an active editor, to later decide in which column the consumer @@ -163,12 +186,12 @@ async function openDocument(uri: vscode.Uri): Promise { // Instead, a new TextEditor instance is added to the active panel. This is the // default vscode behavior await vscode.window.showTextDocument( - document, - { - preview: false, - preserveFocus: true, - viewColumn: hasActiveEditor?vscode.ViewColumn.Beside:vscode.ViewColumn.Active, - } - ); + document, + { + preview: false, + preserveFocus: true, + viewColumn: hasActiveEditor ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active, + } + ); await vscode.languages.setTextDocumentLanguage(document, "kafka-consumer"); } diff --git a/src/extension.ts b/src/extension.ts index e77511e..f18026b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -15,6 +15,7 @@ import { DeleteClusterCommandHandler, SelectClusterCommandHandler, handleErrors, + ClearConsumerViewCommandHandler, } from "./commands"; import { Context } from "./context"; import { BrokerItem, KafkaExplorer, TopicItem } from "./explorer"; @@ -50,6 +51,7 @@ export function activate(context: vscode.ExtensionContext): void { context.subscriptions.push(explorer); context.subscriptions.push(new ConsumerStatusBarItem(consumerCollection)); context.subscriptions.push(new SelectedClusterStatusBarItem(clusterSettings)); + const consumerVirtualTextDocumentProvider = new ConsumerVirtualTextDocumentProvider(consumerCollection) // Commands const createTopicCommandHandler = new CreateTopicCommandHandler(clientAccessor, clusterSettings, explorer); @@ -58,6 +60,7 @@ export function activate(context: vscode.ExtensionContext): void { const startConsumerCommandHandler = new StartConsumerCommandHandler(clientAccessor, clusterSettings, consumerCollection, explorer); const listConsumersCommandHandler = new ListConsumersCommandHandler(consumerCollection); const toggleConsumerCommandHandler = new ToggleConsumerCommandHandler(consumerCollection); + const clearConsumerViewCommandHandler = new ClearConsumerViewCommandHandler(consumerVirtualTextDocumentProvider); const addClusterCommandHandler = new AddClusterCommandHandler(clusterSettings, explorer); const deleteClusterCommandHandler = new DeleteClusterCommandHandler(clusterSettings, clientAccessor, explorer); const selectClusterCommandHandler = new SelectClusterCommandHandler(clusterSettings); @@ -108,8 +111,12 @@ export function activate(context: vscode.ExtensionContext): void { "vscode-kafka.consumer.list", handleErrors(() => listConsumersCommandHandler.execute()))); context.subscriptions.push(vscode.commands.registerCommand( - "vscode-kafka.consumer.toggle", + ToggleConsumerCommandHandler.COMMAND_ID, handleErrors(() => toggleConsumerCommandHandler.execute()))); + context.subscriptions.push(vscode.commands.registerCommand( + ClearConsumerViewCommandHandler.COMMAND_ID, + handleErrors(() => clearConsumerViewCommandHandler.execute()))); + registerVSCodeKafkaDocumentationCommands(context); // .kafka file related @@ -123,8 +130,7 @@ export function activate(context: vscode.ExtensionContext): void { vscode.languages.registerCodeLensProvider(documentSelector, new ProducerCodeLensProvider())); context.subscriptions.push(vscode.workspace.registerTextDocumentContentProvider( - ConsumerVirtualTextDocumentProvider.SCHEME, - new ConsumerVirtualTextDocumentProvider(consumerCollection))); + ConsumerVirtualTextDocumentProvider.SCHEME, consumerVirtualTextDocumentProvider)); } export function deactivate(): void { diff --git a/src/providers/consumerVirtualTextDocumentProvider.ts b/src/providers/consumerVirtualTextDocumentProvider.ts index 9f8935b..f041fa4 100644 --- a/src/providers/consumerVirtualTextDocumentProvider.ts +++ b/src/providers/consumerVirtualTextDocumentProvider.ts @@ -4,6 +4,7 @@ import { ConsumedRecord, ConsumerChangedStatusEvent, ConsumerCollection, Consume import { CommonMessages } from "../constants"; export class ConsumerVirtualTextDocumentProvider implements vscode.TextDocumentContentProvider, vscode.Disposable { + public static SCHEME = "kafka"; private buffer: { [id: string]: string } = {}; private disposables: vscode.Disposable[] = []; @@ -32,10 +33,9 @@ export class ConsumerVirtualTextDocumentProvider implements vscode.TextDocumentC } public provideTextDocumentContent(uri: vscode.Uri): string { - if (!this.buffer.hasOwnProperty(uri.toString())) { + if (!this.isActive(uri)) { return ""; } - return this.buffer[uri.toString()]; } @@ -60,27 +60,20 @@ export class ConsumerVirtualTextDocumentProvider implements vscode.TextDocumentC } private onDidChangeStatus(uri: vscode.Uri, status: string): void { - let uriBuffer = this.buffer[uri.toString()]; + if (!this.isActive(uri)) { + return; + } const line = `Consumer: ${status}\n\n`; - uriBuffer = uriBuffer + line; - - this.buffer[uri.toString()] = uriBuffer; - this.onDidChangeEmitter.fire(uri); + this.updateBuffer(uri, line); } private onDidReceiveRecord(uri: vscode.Uri, message: ConsumedRecord): void { - let uriBuffer = this.buffer[uri.toString()]; - - if (!uriBuffer) { + if (!this.isActive(uri)) { return; } - let line = `Key: ${message.key}\nPartition: ${message.partition}\nOffset: ${message.offset}\n`; line = line + `Value:\n${message.value}\n\n`; - uriBuffer = uriBuffer + line; - - this.buffer[uri.toString()] = uriBuffer; - this.onDidChangeEmitter.fire(uri); + this.updateBuffer(uri, line); } private onDidCloseConsumer(uri: vscode.Uri): void { @@ -93,25 +86,46 @@ export class ConsumerVirtualTextDocumentProvider implements vscode.TextDocumentC private onDidCloseTextDocument(document: vscode.TextDocument): void { // When language is plaintext we assume the event was triggered as a result of switching language mode - if (document.uri.scheme !== "kafka" || document.languageId === "plaintext") { + const uri = document.uri; + if (uri.scheme !== "kafka" || document.languageId === "plaintext") { return; } - const buffer = this.buffer[document.uri.toString()]; - - if (!buffer) { + if (!this.isActive(uri)) { return; } - if (this.consumerCollection.has(document.uri)) { - this.consumerCollection.close(document.uri); + if (this.consumerCollection.has(uri)) { + this.consumerCollection.close(uri); } - delete this.buffer[document.uri.toString()]; + delete this.buffer[uri.toString()]; + } + + public clear(document: vscode.TextDocument): void { + const uri = document.uri; + if (!this.isActive(uri)) { + return; + } + this.updateBuffer(uri, '', true); } public dispose(): void { this.consumerCollection.dispose(); - this.disposables.forEach(d=>d.dispose()); + this.disposables.forEach(d => d.dispose()); + } + + private isActive(uri: vscode.Uri): boolean { + return this.buffer.hasOwnProperty(uri.toString()); + } + + private updateBuffer(uri: vscode.Uri, content: string, replace = false) { + if (replace) { + this.buffer[uri.toString()] = content; + } else { + const uriBuffer = this.buffer[uri.toString()]; + this.buffer[uri.toString()] = uriBuffer + content; + } + this.onDidChangeEmitter.fire(uri); } }