How to use the atom-languageclient/build/lib/adapters/autocomplete-adapter.completionKindToSuggestionType function in atom-languageclient

To help you get started, we’ve selected a few atom-languageclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookarchive / ide-flowtype / lib / FlowAutocompleteAdapter.js View on Github external
static basicCompletionItemToSuggestion(item) {
    const completion = {
      text: item.insertText || item.label,
      displayText: item.label,
      filterText: item.filterText || item.label,
      type: AutocompleteAdapter.completionKindToSuggestionType(item.kind),
      leftLabel: item.detail,
      description: item.documentation,
      descriptionMarkdown: item.documentation,
    };

    if (item._returnDetail) {
      completion.leftLabel = item._returnDetail;
    }
    if (item._parametersDetail) {
      completion.rightLabel = item._parametersDetail;
    }

    return completion;
  }
}