This commit is contained in:
Hackerpilot 2016-06-30 13:26:47 -07:00
parent c490859ab1
commit 84092c36e7
1 changed files with 33 additions and 32 deletions

View File

@ -71,37 +71,37 @@ public AutocompleteResponse getDoc(const AutocompleteRequest request,
warning("Could not find symbol"); warning("Could not find symbol");
else else
{ {
Appender!(char[]) app; Appender!(char[]) app;
void putDDocChar(dchar c) void putDDocChar(dchar c)
{ {
switch (c) switch (c)
{ {
case '\\': case '\\':
app.put('\\'); app.put('\\');
app.put('\\'); app.put('\\');
break; break;
case '\n': case '\n':
app.put('\\'); app.put('\\');
app.put('n'); app.put('n');
break; break;
default: default:
app.put(c); app.put(c);
break; break;
} }
} }
void putDDocString(string s) void putDDocString(string s)
{ {
foreach (c; s) foreach (c; s)
putDDocChar(c); putDDocChar(c);
} }
foreach(symbol; stuff.symbols.filter!(a => !a.doc.empty)) foreach(symbol; stuff.symbols.filter!(a => !a.doc.empty))
{ {
app.clear; app.clear;
putDDocString(symbol.doc); putDDocString(symbol.doc);
response.docComments ~= app.data.idup; response.docComments ~= app.data.idup;
} }
} }
return response; return response;
@ -981,11 +981,12 @@ void setCompletions(T)(ref AutocompleteResponse response,
if (completionType == CompletionType.identifiers) if (completionType == CompletionType.identifiers)
{ {
while (symbols[0].qualifier == SymbolQualifier.func while (symbols[0].qualifier == SymbolQualifier.func
|| symbols[0].kind == CompletionKind.functionName || symbols[0].kind == CompletionKind.functionName
|| symbols[0].kind == CompletionKind.importSymbol || symbols[0].kind == CompletionKind.importSymbol
|| symbols[0].kind == CompletionKind.aliasName) || symbols[0].kind == CompletionKind.aliasName)
{ {
symbols = symbols[0].type is null ? [] : [symbols[0].type]; symbols = symbols[0].type is null || symbols[0].type is symbols[0] ? []
: [symbols[0].type];
if (symbols.length == 0) if (symbols.length == 0)
return; return;
} }
@ -1248,11 +1249,11 @@ body
case tok!"doubleLiteral": case tok!"doubleLiteral":
case tok!"floatLiteral": case tok!"floatLiteral":
case tok!"idoubleLiteral": case tok!"idoubleLiteral":
case tok!"ifloatLiteral": case tok!"ifloatLiteral":
case tok!"intLiteral": case tok!"intLiteral":
case tok!"longLiteral": case tok!"longLiteral":
case tok!"realLiteral": case tok!"realLiteral":
case tok!"irealLiteral": case tok!"irealLiteral":
case tok!"uintLiteral": case tok!"uintLiteral":
case tok!"ulongLiteral": case tok!"ulongLiteral":
case tok!"characterLiteral": case tok!"characterLiteral":