onivim/oni

TypeScript: Hook up auto-import functionality

Open

#1,593 opened on Feb 21, 2018

View on GitHub
 (12 comments) (3 reactions) (1 assignee)TypeScript (336 forks)batch import
bountybounty-100enhancementhelp wanted

Repository metrics

Stars
 (11,389 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Splitting out from #1326 - integrate 'auto-import' functionality from TypeScript. This should generalize to other completion providers, too.

  • Implement additionalTextEdits and textEdit for CompletionItems as defined by the completion request in the language server protocol: https://microsoft.github.io/language-server-protocol/specification
  • Update our TypeScriptServerHost to send additionalTextEdits for auto-imports. This will involve settting the includeExternalModuleExports for the completions request, hooking up entry details resolution to get information about the additional code actions as part of the details request, and resolving those code actions to text edits. Looks like we'll need to plumb the 'source' through somehow, as this is needed when calling to get details.

Contributor guide