typescript-plugins-text-based-user-interaction
high level API for external process providing with input user experience like inputText, selectOption, showMessage, etc
Motivation: in one side I have TypeScript plugins that are editor agnostic. But they need a way to ask the user for input. By default I'm solving this with project, that is also editor agnostic.
This project is about easily providing Input UI from external editor extensions so TypeScript plugins can ask for input agnostically - if there is any provider. For example, vscode extension ../vscode-typescript-refactors provides with minimal input UI so typescript plugins delegate Input UI inquirer to that extension, using this package API to be agnostic
Heads up : Input UI APi is async while TypesScript language service API is sync - but since I'm implementing them with ts-simple-ast it doesn't matter.
Perform IPC comunication!
Consumer
await consumer.askSupportifconsumer.hasSupportACTION.inputText
Provider
TODO
- destroy() the socket
- tests
- select (multiple)
- right now consumers are server and providers are clients - so we can only instantiate one consumer. since we we have only one provider (in the editor) - probably we want to have the server in the editor (provider) so one or more plugins can consume. solved with consumerInstance but dont know if is enough.
Dones
- showmessage, error, warning
- askSupported not to send if this support already was setted
- selectText and move cursor (change feedback) - so we can selectthe text changed after the refactor and also control the cursor just in case.