hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
CompletionProvider Class Reference

#include <completion.h>

Public Member Functions

CompletionList provide (Document *doc, const Position &pos)
 

Private Member Functions

std::vector< CompletionItemkeywordCompletions (const std::string &prefix)
 
std::vector< CompletionItemuseModuleCompletions (Document *doc, const std::string &prefix)
 
std::vector< CompletionItemusePathCompletions (Document *doc, const std::string &pathPrefix)
 
std::vector< CompletionItemsymbolCompletions (Document *doc, const std::string &prefix, int cursorLine)
 
std::vector< CompletionItemcrossModuleCompletions (Document *doc, const std::string &prefix)
 
std::vector< CompletionItemmemberCompletions (Document *doc, const std::string &parent, const std::string &prefix, int cursorLine=-1)
 
std::vector< CompletionItemresolveModuleCompletionsFromText (Document *doc, const std::string &parent, const std::string &prefix)
 
std::vector< CompletionItemcompletionsForType (Document *doc, const yoi::wstr &typeName, const std::string &prefix)
 
std::vector< CompletionItemcompletionsForTypeNameFromModules (Document *doc, const std::string &typeName, const std::string &prefix)
 
CompletionItem symbolToCompletionItem (const Symbol &sym)
 

Detailed Description

Definition at line 13 of file completion.h.

Member Function Documentation

◆ completionsForType()

std::vector< CompletionItem > completionsForType ( Document doc,
const yoi::wstr typeName,
const std::string &  prefix 
)
private

◆ completionsForTypeNameFromModules()

std::vector< CompletionItem > completionsForTypeNameFromModules ( Document doc,
const std::string &  typeName,
const std::string &  prefix 
)
private

◆ crossModuleCompletions()

std::vector< CompletionItem > crossModuleCompletions ( Document doc,
const std::string &  prefix 
)
private

Definition at line 319 of file completion.cpp.

References Document::crossModuleSymbols, CompletionItem::documentation, CompletionItem::insertText, CompletionItem::label, CompletionItem::sortText, CompletionProvider::symbolToCompletionItem(), and yoi::wstring2string().

Referenced by CompletionProvider::provide().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keywordCompletions()

std::vector< CompletionItem > keywordCompletions ( const std::string &  prefix)
private

Definition at line 375 of file completion.cpp.

References CompletionItem::detail, CompletionItem::insertText, lsp::Keyword, CompletionItem::kind, CompletionItem::label, and CompletionItem::sortText.

Referenced by CompletionProvider::provide().

Here is the caller graph for this function:

◆ memberCompletions()

std::vector< CompletionItem > memberCompletions ( Document doc,
const std::string &  parent,
const std::string &  prefix,
int  cursorLine = -1 
)
private

◆ provide()

◆ resolveModuleCompletionsFromText()

◆ symbolCompletions()

std::vector< CompletionItem > symbolCompletions ( Document doc,
const std::string &  prefix,
int  cursorLine 
)
private

◆ symbolToCompletionItem()

◆ useModuleCompletions()

std::vector< CompletionItem > useModuleCompletions ( Document doc,
const std::string &  prefix 
)
private

Definition at line 440 of file completion.cpp.

References CompletionItem::detail, CompletionItem::insertText, CompletionItem::kind, CompletionItem::label, lsp::Module, lsp::moduleSearchRoots(), and CompletionItem::sortText.

Referenced by CompletionProvider::provide().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usePathCompletions()

std::vector< CompletionItem > usePathCompletions ( Document doc,
const std::string &  pathPrefix 
)
private

Definition at line 472 of file completion.cpp.

References CompletionItem::detail, lsp::File, lsp::Folder, CompletionItem::insertText, CompletionItem::kind, CompletionItem::label, lsp::moduleSearchRoots(), and CompletionItem::sortText.

Referenced by CompletionProvider::provide().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: