replace stdx-allocator with std.experimental
This commit is contained in:
parent
2bfd3d004f
commit
4594a63634
|
@ -34,9 +34,6 @@ for /r "libdparse/src" %%F in (*.d) do call set libdparse_modules=%%libdparse_mo
|
||||||
set msgspack_modules=
|
set msgspack_modules=
|
||||||
for /r "msgpack-d/src" %%F in (*.d) do call set msgspack_modules=%%msgspack_modules%% "%%F"
|
for /r "msgpack-d/src" %%F in (*.d) do call set msgspack_modules=%%msgspack_modules%% "%%F"
|
||||||
|
|
||||||
set stdx_allocator=
|
|
||||||
for /r "stdx-allocator/source/stdx/allocator" %%F in (*.d) do call set stdx_allocator=%%stdx_allocator%% "%%F"
|
|
||||||
|
|
||||||
set client_name=bin\dcd-client
|
set client_name=bin\dcd-client
|
||||||
set server_name=bin\dcd-server
|
set server_name=bin\dcd-server
|
||||||
|
|
||||||
|
@ -59,11 +56,9 @@ set server_name=bin\dcd-server
|
||||||
%common_modules%^
|
%common_modules%^
|
||||||
%containers_modules%^
|
%containers_modules%^
|
||||||
%msgspack_modules%^
|
%msgspack_modules%^
|
||||||
%stdx_allocator%^
|
|
||||||
-Icontainers/src^
|
-Icontainers/src^
|
||||||
-Imsgpack-d/src^
|
-Imsgpack-d/src^
|
||||||
-Ilibdparse/src^
|
-Ilibdparse/src^
|
||||||
-Istdx-allocator/source^
|
|
||||||
-wi -O -release^
|
-wi -O -release^
|
||||||
-Jbin^
|
-Jbin^
|
||||||
%MFLAGS%^
|
%MFLAGS%^
|
||||||
|
|
2
dsymbol
2
dsymbol
|
@ -1 +1 @@
|
||||||
Subproject commit f9a3d302527a9e50140991562648a147b6f5a78e
|
Subproject commit 46873f01f74844ab0bea0af14643cdd791573505
|
5
dub.json
5
dub.json
|
@ -7,10 +7,9 @@
|
||||||
],
|
],
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dsymbol": ">=0.11.2 <0.12.0",
|
"dsymbol": ">=0.14.0 <0.15.0",
|
||||||
"libdparse": ">=0.15.4 <0.16.0",
|
"libdparse": ">=0.20.0 <0.21.0",
|
||||||
":common": "*",
|
":common": "*",
|
||||||
"stdx-allocator": "~>2.77.5",
|
|
||||||
"emsi_containers": "~>0.8.0"
|
"emsi_containers": "~>0.8.0"
|
||||||
},
|
},
|
||||||
"subPackages": ["common"],
|
"subPackages": ["common"],
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 1393ee4d0c8e50011e641e06d64c429841fb3c2b
|
Subproject commit c3fa4e6eb3720c6aad9e9a772a919ccee2cf1215
|
3
makefile
3
makefile
|
@ -12,7 +12,6 @@ LDC := ldc2
|
||||||
|
|
||||||
DPARSE_DIR := libdparse
|
DPARSE_DIR := libdparse
|
||||||
DSYMBOL_DIR := dsymbol
|
DSYMBOL_DIR := dsymbol
|
||||||
STDXALLOC_DIR := stdx-allocator
|
|
||||||
|
|
||||||
SHELL:=/bin/bash
|
SHELL:=/bin/bash
|
||||||
|
|
||||||
|
@ -65,7 +64,6 @@ SERVER_SRC := \
|
||||||
$(shell find common/src/dcd/common -name "*.d")\
|
$(shell find common/src/dcd/common -name "*.d")\
|
||||||
$(shell find src/dcd/server -name "*.d")\
|
$(shell find src/dcd/server -name "*.d")\
|
||||||
$(shell find ${DSYMBOL_DIR}/src -name "*.d")\
|
$(shell find ${DSYMBOL_DIR}/src -name "*.d")\
|
||||||
$(shell find ${STDXALLOC_DIR}/source -name "*.d")\
|
|
||||||
$(shell find ${DPARSE_DIR}/src -name "*.d")\
|
$(shell find ${DPARSE_DIR}/src -name "*.d")\
|
||||||
$(shell find containers/src -name "*.d")\
|
$(shell find containers/src -name "*.d")\
|
||||||
$(shell find msgpack-d/src/ -name "*.d")
|
$(shell find msgpack-d/src/ -name "*.d")
|
||||||
|
@ -74,7 +72,6 @@ DMD_SERVER_FLAGS := -Icontainers/src\
|
||||||
-Imsgpack-d/src\
|
-Imsgpack-d/src\
|
||||||
-I${DPARSE_DIR}/src\
|
-I${DPARSE_DIR}/src\
|
||||||
-I${DSYMBOL_DIR}/src\
|
-I${DSYMBOL_DIR}/src\
|
||||||
-I${STDXALLOC_DIR}/source\
|
|
||||||
-Jbin\
|
-Jbin\
|
||||||
-wi\
|
-wi\
|
||||||
-O\
|
-O\
|
||||||
|
|
|
@ -21,6 +21,7 @@ module dcd.server.autocomplete.complete;
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
import std.array;
|
import std.array;
|
||||||
import std.conv;
|
import std.conv;
|
||||||
|
import std.experimental.allocator;
|
||||||
import std.experimental.logger;
|
import std.experimental.logger;
|
||||||
import std.file;
|
import std.file;
|
||||||
import std.path;
|
import std.path;
|
||||||
|
@ -215,8 +216,8 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, const(Token)[] tokenArray,
|
||||||
case tok!"]":
|
case tok!"]":
|
||||||
scope allocator = new ASTAllocator();
|
scope allocator = new ASTAllocator();
|
||||||
RollbackAllocator rba;
|
RollbackAllocator rba;
|
||||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||||
&rba, cursorPosition, moduleCache);
|
allocator.allocatorObject, &rba, cursorPosition, moduleCache);
|
||||||
scope(exit) pair.destroy();
|
scope(exit) pair.destroy();
|
||||||
response.setCompletions(pair.scope_, getExpression(beforeTokens),
|
response.setCompletions(pair.scope_, getExpression(beforeTokens),
|
||||||
cursorPosition, CompletionType.identifiers, false, partial);
|
cursorPosition, CompletionType.identifiers, false, partial);
|
||||||
|
@ -231,8 +232,8 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, const(Token)[] tokenArray,
|
||||||
case tok!",":
|
case tok!",":
|
||||||
scope allocator = new ASTAllocator();
|
scope allocator = new ASTAllocator();
|
||||||
RollbackAllocator rba;
|
RollbackAllocator rba;
|
||||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||||
&rba, 1, moduleCache);
|
allocator.allocatorObject, &rba, 1, moduleCache);
|
||||||
scope(exit) pair.destroy();
|
scope(exit) pair.destroy();
|
||||||
response.setCompletions(pair.scope_, getExpression(beforeTokens),
|
response.setCompletions(pair.scope_, getExpression(beforeTokens),
|
||||||
1, CompletionType.identifiers, false, partial);
|
1, CompletionType.identifiers, false, partial);
|
||||||
|
@ -304,8 +305,8 @@ AutocompleteResponse parenCompletion(T)(T beforeTokens,
|
||||||
mixin(STRING_LITERAL_CASES);
|
mixin(STRING_LITERAL_CASES);
|
||||||
scope allocator = new ASTAllocator();
|
scope allocator = new ASTAllocator();
|
||||||
RollbackAllocator rba;
|
RollbackAllocator rba;
|
||||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||||
&rba, cursorPosition, moduleCache);
|
allocator.allocatorObject, &rba, cursorPosition, moduleCache);
|
||||||
scope(exit) pair.destroy();
|
scope(exit) pair.destroy();
|
||||||
auto expression = getExpression(beforeTokens[0 .. $ - 1]);
|
auto expression = getExpression(beforeTokens[0 .. $ - 1]);
|
||||||
response.setCompletions(pair.scope_, expression,
|
response.setCompletions(pair.scope_, expression,
|
||||||
|
|
|
@ -20,6 +20,7 @@ module dcd.server.autocomplete.doc;
|
||||||
|
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
import std.array;
|
import std.array;
|
||||||
|
import std.experimental.allocator;
|
||||||
import std.experimental.logger;
|
import std.experimental.logger;
|
||||||
import std.typecons;
|
import std.typecons;
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ public AutocompleteResponse getDoc(const AutocompleteRequest request,
|
||||||
scope allocator = new ASTAllocator();
|
scope allocator = new ASTAllocator();
|
||||||
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
|
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
|
||||||
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.ddoc,
|
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.ddoc,
|
||||||
allocator, &rba, cache, moduleCache);
|
allocator.allocatorObject, &rba, cache, moduleCache);
|
||||||
if (stuff.symbols.length == 0)
|
if (stuff.symbols.length == 0)
|
||||||
warning("Could not find symbol");
|
warning("Could not find symbol");
|
||||||
else
|
else
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
module dcd.server.autocomplete.localuse;
|
module dcd.server.autocomplete.localuse;
|
||||||
|
|
||||||
|
import std.experimental.allocator;
|
||||||
import std.experimental.logger;
|
import std.experimental.logger;
|
||||||
import std.range;
|
import std.range;
|
||||||
import std.typecons;
|
import std.typecons;
|
||||||
|
@ -60,8 +61,8 @@ public AutocompleteResponse findLocalUse(AutocompleteRequest request,
|
||||||
{
|
{
|
||||||
auto sortedTokens = assumeSorted(tokenArray);
|
auto sortedTokens = assumeSorted(tokenArray);
|
||||||
auto beforeTokens = sortedTokens.lowerBound(cursorPosition);
|
auto beforeTokens = sortedTokens.lowerBound(cursorPosition);
|
||||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||||
&rba, request.cursorPosition, moduleCache);
|
allocator.allocatorObject, &rba, request.cursorPosition, moduleCache);
|
||||||
auto expression = getExpression(beforeTokens);
|
auto expression = getExpression(beforeTokens);
|
||||||
return SymbolStuff(getSymbolsByTokenChain(pair.scope_, expression,
|
return SymbolStuff(getSymbolsByTokenChain(pair.scope_, expression,
|
||||||
cursorPosition, CompletionType.location), pair.symbol, pair.scope_);
|
cursorPosition, CompletionType.location), pair.symbol, pair.scope_);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
module dcd.server.autocomplete.symbols;
|
module dcd.server.autocomplete.symbols;
|
||||||
|
|
||||||
|
import std.experimental.allocator;
|
||||||
import std.experimental.logger;
|
import std.experimental.logger;
|
||||||
import std.typecons;
|
import std.typecons;
|
||||||
|
|
||||||
|
@ -49,8 +50,8 @@ public AutocompleteResponse findDeclaration(const AutocompleteRequest request,
|
||||||
RollbackAllocator rba;
|
RollbackAllocator rba;
|
||||||
scope allocator = new ASTAllocator();
|
scope allocator = new ASTAllocator();
|
||||||
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
|
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
|
||||||
SymbolStuff stuff = getSymbolsForCompletion(request,
|
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.location,
|
||||||
CompletionType.location, allocator, &rba, cache, moduleCache);
|
allocator.allocatorObject, &rba, cache, moduleCache);
|
||||||
scope(exit) stuff.destroy();
|
scope(exit) stuff.destroy();
|
||||||
if (stuff.symbols.length > 0)
|
if (stuff.symbols.length > 0)
|
||||||
{
|
{
|
||||||
|
@ -77,8 +78,8 @@ public AutocompleteResponse symbolSearch(const AutocompleteRequest request,
|
||||||
config, &cache);
|
config, &cache);
|
||||||
scope allocator = new ASTAllocator();
|
scope allocator = new ASTAllocator();
|
||||||
RollbackAllocator rba;
|
RollbackAllocator rba;
|
||||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||||
&rba, request.cursorPosition, moduleCache);
|
allocator.allocatorObject, &rba, request.cursorPosition, moduleCache);
|
||||||
scope(exit) pair.destroy();
|
scope(exit) pair.destroy();
|
||||||
|
|
||||||
static struct SearchResults
|
static struct SearchResults
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
module dcd.server.autocomplete.util;
|
module dcd.server.autocomplete.util;
|
||||||
|
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
import stdx.allocator;
|
import std.experimental.allocator;
|
||||||
import std.experimental.logger;
|
import std.experimental.logger;
|
||||||
import std.range;
|
import std.range;
|
||||||
import std.string;
|
import std.string;
|
||||||
|
@ -134,7 +134,7 @@ auto getTokensBeforeCursor(const(ubyte[]) sourceCode, size_t cursorPosition,
|
||||||
* the request's source code, cursor position, and completion type.
|
* the request's source code, cursor position, and completion type.
|
||||||
*/
|
*/
|
||||||
SymbolStuff getSymbolsForCompletion(const AutocompleteRequest request,
|
SymbolStuff getSymbolsForCompletion(const AutocompleteRequest request,
|
||||||
const CompletionType type, IAllocator allocator, RollbackAllocator* rba,
|
const CompletionType type, RCIAllocator allocator, RollbackAllocator* rba,
|
||||||
ref StringCache cache, ref ModuleCache moduleCache)
|
ref StringCache cache, ref ModuleCache moduleCache)
|
||||||
{
|
{
|
||||||
const(Token)[] tokenArray;
|
const(Token)[] tokenArray;
|
||||||
|
|
|
@ -24,8 +24,8 @@ import std.array;
|
||||||
import std.conv;
|
import std.conv;
|
||||||
import std.datetime.stopwatch : AutoStart, StopWatch;
|
import std.datetime.stopwatch : AutoStart, StopWatch;
|
||||||
import std.exception : enforce;
|
import std.exception : enforce;
|
||||||
import stdx.allocator;
|
import std.experimental.allocator;
|
||||||
import stdx.allocator.mallocator;
|
import std.experimental.allocator.mallocator;
|
||||||
import std.experimental.logger;
|
import std.experimental.logger;
|
||||||
import std.file;
|
import std.file;
|
||||||
import std.getopt;
|
import std.getopt;
|
||||||
|
@ -176,7 +176,7 @@ int runServer(string[] args)
|
||||||
info("Sockets shut down.");
|
info("Sockets shut down.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleCache cache = ModuleCache(new ASTAllocator);
|
ModuleCache cache = ModuleCache(new ASTAllocator().allocatorObject);
|
||||||
cache.addImportPaths(importPaths);
|
cache.addImportPaths(importPaths);
|
||||||
infof("Import directories:\n %-(%s\n %)", cache.getImportPaths());
|
infof("Import directories:\n %-(%s\n %)", cache.getImportPaths());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue