**Problem** Jsx tag auto-closing is one of VS Code's more requested JS/TS features: https://github.com/Microsoft/vscode/issues/34307 As a basic example, typing out: ```js const z = | ``` would auto close to: ```js const z = | ``` We can look into fixing this entirely on the VS Code side, but I think it may be worth adding this feature to the TSServer API so that other editors such as VS can also benefit **Proposed API** Add a new `autoCloseTag` request to the ts server: ```ts interface AutoCloseTagRequestArgs extends FileLocationRequestArgs { } interface AutoCloseTagRequest extends FileLocationRequest { command: 'autoCloseTag'; arguments: AutoCloseTagRequestArgs; } ``` This request would take a file and a location within the tag to try to auto close. If applicable, it would return a text insertion that auto-closes that tag: ```js interface AutoCloseResponse extends Response { body?: TextInsertion } ``` **Case 1** ```ts const z = ``` - Editor requests auto close at somewhere inside the `` tag. Server returns insertion to create: ```ts const z = ``` **Case 2** ```ts const z = ``` or ```ts const z = ``` - Editor requests auto close at location inside either opening tag. Not result returned. Tag already closed **Case 3** - Editor requests auto close location for a location not inside a jsx opening tag No result returned **Case 4** ```ts const z = ``` - Editor requests auto close at location in the `` tag Returns auto close for `` ```ts const z = ``` **Case 5** ```ts const z = text ``` - Editor requests auto close at somewhere inside the `` tag. Returns insertion to add closing tag at end of the text content: ```ts const z = text ```