Adjust to requested changes
This commit is contained in:
parent
ad0335b1ad
commit
17789292e0
|
|
@ -385,12 +385,12 @@ void setImportCompletions(T)(T tokens, ref AutocompleteResponse response,
|
|||
{
|
||||
if (n[0] != '.' && (partial is null || n.startsWith(partial)))
|
||||
{
|
||||
string packageDPath = buildPath(name, "package.d");
|
||||
string packageDIPath = buildPath(name, "package.di");
|
||||
bool packageD = exists(packageDPath);
|
||||
bool packageDI = exists(packageDIPath);
|
||||
auto kind = packageD || packageDI ? CompletionKind.moduleName : CompletionKind.packageName;
|
||||
string file = packageD ? packageDPath : packageDI ? packageDIPath : name;
|
||||
immutable packageDPath = buildPath(name, "package.d");
|
||||
immutable packageDIPath = buildPath(name, "package.di");
|
||||
immutable packageD = exists(packageDPath);
|
||||
immutable packageDI = exists(packageDIPath);
|
||||
immutable kind = packageD || packageDI ? CompletionKind.moduleName : CompletionKind.packageName;
|
||||
immutable file = packageD ? packageDPath : packageDI ? packageDIPath : name;
|
||||
response.completions ~= AutocompleteResponse.Completion(n, kind, null, file, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -742,12 +742,13 @@ unittest
|
|||
AutocompleteResponse.Completion makeSymbolCompletionInfo(const DSymbol* symbol, char kind)
|
||||
{
|
||||
string definition;
|
||||
if ((kind == 'v' || kind == 'm') && symbol.type)
|
||||
if ((kind == CompletionKind.variableName || kind == CompletionKind.memberVariableName) && symbol.type)
|
||||
definition = symbol.type.name ~ ' ' ~ symbol.name;
|
||||
else if (kind == 'e')
|
||||
definition = symbol.name;
|
||||
else if (kind == CompletionKind.enumMember)
|
||||
definition = symbol.name; // TODO: add enum value to definition string
|
||||
else
|
||||
definition = symbol.callTip;
|
||||
// TODO: definition strings could include more information, like on classes inheritance
|
||||
return AutocompleteResponse.Completion(symbol.name, kind, definition,
|
||||
symbol.symbolFile, symbol.location, symbol.doc);
|
||||
}
|
||||
Loading…
Reference in New Issue