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