Update containers
This commit is contained in:
parent
bb34e38d4f
commit
b30e542fe5
|
@ -1 +1 @@
|
||||||
Subproject commit afdc2ec1e378b19ebce542072520d36eaa508ede
|
Subproject commit b38769605779983aeca3819fbcfa8c72156f9ceb
|
2
dsymbol
2
dsymbol
|
@ -1 +1 @@
|
||||||
Subproject commit 4ac656541a719c27cf549fddcb1e85cf702ce804
|
Subproject commit 4a2b4109a7ffa15a8ada6c0ea06031409781257e
|
2
makefile
2
makefile
|
@ -68,7 +68,6 @@ SERVER_SRC := \
|
||||||
libdparse/src/std/lexer.d\
|
libdparse/src/std/lexer.d\
|
||||||
$(shell find containers/experimental_allocator/src/std/experimental/allocator/ -name "*.d")\
|
$(shell find containers/experimental_allocator/src/std/experimental/allocator/ -name "*.d")\
|
||||||
containers/src/memory/allocators.d\
|
containers/src/memory/allocators.d\
|
||||||
containers/src/memory/appender.d\
|
|
||||||
containers/src/containers/dynamicarray.d\
|
containers/src/containers/dynamicarray.d\
|
||||||
containers/src/containers/ttree.d\
|
containers/src/containers/ttree.d\
|
||||||
containers/src/containers/unrolledlist.d\
|
containers/src/containers/unrolledlist.d\
|
||||||
|
@ -77,6 +76,7 @@ SERVER_SRC := \
|
||||||
containers/src/containers/internal/hash.d\
|
containers/src/containers/internal/hash.d\
|
||||||
containers/src/containers/internal/node.d\
|
containers/src/containers/internal/node.d\
|
||||||
containers/src/containers/internal/storage_type.d\
|
containers/src/containers/internal/storage_type.d\
|
||||||
|
containers/src/containers/internal/element_type.d\
|
||||||
containers/src/containers/slist.d\
|
containers/src/containers/slist.d\
|
||||||
msgpack-d/src/msgpack.d
|
msgpack-d/src/msgpack.d
|
||||||
|
|
||||||
|
|
|
@ -159,14 +159,14 @@ public AutocompleteResponse symbolSearch(const AutocompleteRequest request,
|
||||||
|
|
||||||
static struct SearchResults
|
static struct SearchResults
|
||||||
{
|
{
|
||||||
void put(DSymbol* symbol)
|
void put(const(DSymbol)* symbol)
|
||||||
{
|
{
|
||||||
tree.insert(SearchResult(symbol));
|
tree.insert(SearchResult(symbol));
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct SearchResult
|
static struct SearchResult
|
||||||
{
|
{
|
||||||
DSymbol* symbol;
|
const(DSymbol)* symbol;
|
||||||
|
|
||||||
int opCmp(ref const SearchResult other) const pure nothrow
|
int opCmp(ref const SearchResult other) const pure nothrow
|
||||||
{
|
{
|
||||||
|
@ -555,7 +555,7 @@ body
|
||||||
import containers.hashset : HashSet;
|
import containers.hashset : HashSet;
|
||||||
HashSet!string h;
|
HashSet!string h;
|
||||||
|
|
||||||
void addSymbolToResponses(DSymbol* sy)
|
void addSymbolToResponses(const(DSymbol)* sy)
|
||||||
{
|
{
|
||||||
auto a = DSymbol(sy.name);
|
auto a = DSymbol(sy.name);
|
||||||
if (!builtinSymbols.contains(&a) && sy.name !is null && !h.contains(sy.name)
|
if (!builtinSymbols.contains(&a) && sy.name !is null && !h.contains(sy.name)
|
||||||
|
@ -819,7 +819,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
||||||
Scope* completionScope, T tokens, size_t cursorPosition,
|
Scope* completionScope, T tokens, size_t cursorPosition,
|
||||||
CompletionType completionType, bool isBracket = false, string partial = null)
|
CompletionType completionType, bool isBracket = false, string partial = null)
|
||||||
{
|
{
|
||||||
static void addSymToResponse(DSymbol* s, ref AutocompleteResponse r, string p,
|
static void addSymToResponse(const(DSymbol)* s, ref AutocompleteResponse r, string p,
|
||||||
size_t[] circularGuard = [])
|
size_t[] circularGuard = [])
|
||||||
{
|
{
|
||||||
if (circularGuard.canFind(cast(size_t) s))
|
if (circularGuard.canFind(cast(size_t) s))
|
||||||
|
@ -828,7 +828,8 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
||||||
{
|
{
|
||||||
if (sym.name !is null && sym.name.length > 0 && sym.kind != CompletionKind.importSymbol
|
if (sym.name !is null && sym.name.length > 0 && sym.kind != CompletionKind.importSymbol
|
||||||
&& (p is null ? true : sym.name.toUpper().startsWith(p.toUpper()))
|
&& (p is null ? true : sym.name.toUpper().startsWith(p.toUpper()))
|
||||||
&& !r.completions.canFind(sym.name))
|
&& !r.completions.canFind(sym.name)
|
||||||
|
&& sym.name[0] != '*')
|
||||||
{
|
{
|
||||||
r.completionKinds ~= sym.kind;
|
r.completionKinds ~= sym.kind;
|
||||||
r.completions ~= sym.name.dup;
|
r.completions ~= sym.name.dup;
|
||||||
|
@ -949,25 +950,26 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
||||||
string generateStructConstructorCalltip(const DSymbol* symbol)
|
string generateStructConstructorCalltip(const DSymbol* symbol)
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
assert (symbol.kind == CompletionKind.structName);
|
assert(symbol.kind == CompletionKind.structName);
|
||||||
}
|
}
|
||||||
body
|
body
|
||||||
{
|
{
|
||||||
string generatedStructConstructorCalltip = "this(";
|
string generatedStructConstructorCalltip = "this(";
|
||||||
size_t i = 0;
|
const(DSymbol)*[] fields = symbol.opSlice().filter!(
|
||||||
immutable c = count(symbol.opSlice().filter!(a => a.kind == CompletionKind.variableName));
|
a => a.kind == CompletionKind.variableName).map!(a => cast(const(DSymbol)*) a.ptr).array();
|
||||||
foreach (part; array(symbol.opSlice()).sort!((a, b) => a.location < b.location))
|
fields.sort!((a, b) => a.location < b.location);
|
||||||
|
foreach (i, field; fields)
|
||||||
{
|
{
|
||||||
if (part.kind != CompletionKind.variableName)
|
if (field.kind != CompletionKind.variableName)
|
||||||
continue;
|
continue;
|
||||||
i++;
|
i++;
|
||||||
if (part.type !is null)
|
if (field.type !is null)
|
||||||
{
|
{
|
||||||
generatedStructConstructorCalltip ~= part.type.name;
|
generatedStructConstructorCalltip ~= field.type.name;
|
||||||
generatedStructConstructorCalltip ~= " ";
|
generatedStructConstructorCalltip ~= " ";
|
||||||
}
|
}
|
||||||
generatedStructConstructorCalltip ~= part.name;
|
generatedStructConstructorCalltip ~= field.name;
|
||||||
if (i < c)
|
if (i < fields.length)
|
||||||
generatedStructConstructorCalltip ~= ", ";
|
generatedStructConstructorCalltip ~= ", ";
|
||||||
}
|
}
|
||||||
generatedStructConstructorCalltip ~= ")";
|
generatedStructConstructorCalltip ~= ")";
|
||||||
|
|
Loading…
Reference in New Issue