replace stdx-allocator with std.experimental
This commit is contained in:
parent
2bfd3d004f
commit
8ccc715426
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",
|
||||
"dependencies": {
|
||||
"dsymbol": ">=0.11.2 <0.12.0",
|
||||
"libdparse": ">=0.15.4 <0.16.0",
|
||||
"dsymbol": ">=0.14.0 <0.15.0",
|
||||
"libdparse": ">=0.20.0 <0.21.0",
|
||||
":common": "*",
|
||||
"stdx-allocator": "~>2.77.5",
|
||||
"emsi_containers": "~>0.8.0"
|
||||
},
|
||||
"subPackages": ["common"],
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1393ee4d0c8e50011e641e06d64c429841fb3c2b
|
||||
Subproject commit c3fa4e6eb3720c6aad9e9a772a919ccee2cf1215
|
||||
|
|
@ -21,6 +21,7 @@ module dcd.server.autocomplete.complete;
|
|||
import std.algorithm;
|
||||
import std.array;
|
||||
import std.conv;
|
||||
import std.experimental.allocator;
|
||||
import std.experimental.logger;
|
||||
import std.file;
|
||||
import std.path;
|
||||
|
|
@ -215,8 +216,8 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, const(Token)[] tokenArray,
|
|||
case tok!"]":
|
||||
scope allocator = new ASTAllocator();
|
||||
RollbackAllocator rba;
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
||||
&rba, cursorPosition, moduleCache);
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||
allocator.allocatorObject, &rba, cursorPosition, moduleCache);
|
||||
scope(exit) pair.destroy();
|
||||
response.setCompletions(pair.scope_, getExpression(beforeTokens),
|
||||
cursorPosition, CompletionType.identifiers, false, partial);
|
||||
|
|
@ -231,8 +232,8 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, const(Token)[] tokenArray,
|
|||
case tok!",":
|
||||
scope allocator = new ASTAllocator();
|
||||
RollbackAllocator rba;
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
||||
&rba, 1, moduleCache);
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||
allocator.allocatorObject, &rba, 1, moduleCache);
|
||||
scope(exit) pair.destroy();
|
||||
response.setCompletions(pair.scope_, getExpression(beforeTokens),
|
||||
1, CompletionType.identifiers, false, partial);
|
||||
|
|
@ -304,8 +305,8 @@ AutocompleteResponse parenCompletion(T)(T beforeTokens,
|
|||
mixin(STRING_LITERAL_CASES);
|
||||
scope allocator = new ASTAllocator();
|
||||
RollbackAllocator rba;
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
||||
&rba, cursorPosition, moduleCache);
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||
allocator.allocatorObject, &rba, cursorPosition, moduleCache);
|
||||
scope(exit) pair.destroy();
|
||||
auto expression = getExpression(beforeTokens[0 .. $ - 1]);
|
||||
response.setCompletions(pair.scope_, expression,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ module dcd.server.autocomplete.doc;
|
|||
|
||||
import std.algorithm;
|
||||
import std.array;
|
||||
import std.experimental.allocator;
|
||||
import std.experimental.logger;
|
||||
import std.typecons;
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ public AutocompleteResponse getDoc(const AutocompleteRequest request,
|
|||
scope allocator = new ASTAllocator();
|
||||
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
|
||||
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.ddoc,
|
||||
allocator, &rba, cache, moduleCache);
|
||||
allocator.allocatorObject, &rba, cache, moduleCache);
|
||||
if (stuff.symbols.length == 0)
|
||||
warning("Could not find symbol");
|
||||
else
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
module dcd.server.autocomplete.localuse;
|
||||
|
||||
import std.experimental.allocator;
|
||||
import std.experimental.logger;
|
||||
import std.range;
|
||||
import std.typecons;
|
||||
|
|
@ -60,8 +61,8 @@ public AutocompleteResponse findLocalUse(AutocompleteRequest request,
|
|||
{
|
||||
auto sortedTokens = assumeSorted(tokenArray);
|
||||
auto beforeTokens = sortedTokens.lowerBound(cursorPosition);
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
||||
&rba, request.cursorPosition, moduleCache);
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||
allocator.allocatorObject, &rba, request.cursorPosition, moduleCache);
|
||||
auto expression = getExpression(beforeTokens);
|
||||
return SymbolStuff(getSymbolsByTokenChain(pair.scope_, expression,
|
||||
cursorPosition, CompletionType.location), pair.symbol, pair.scope_);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
module dcd.server.autocomplete.symbols;
|
||||
|
||||
import std.experimental.allocator;
|
||||
import std.experimental.logger;
|
||||
import std.typecons;
|
||||
|
||||
|
|
@ -49,8 +50,8 @@ public AutocompleteResponse findDeclaration(const AutocompleteRequest request,
|
|||
RollbackAllocator rba;
|
||||
scope allocator = new ASTAllocator();
|
||||
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
|
||||
SymbolStuff stuff = getSymbolsForCompletion(request,
|
||||
CompletionType.location, allocator, &rba, cache, moduleCache);
|
||||
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.location,
|
||||
allocator.allocatorObject, &rba, cache, moduleCache);
|
||||
scope(exit) stuff.destroy();
|
||||
if (stuff.symbols.length > 0)
|
||||
{
|
||||
|
|
@ -77,8 +78,8 @@ public AutocompleteResponse symbolSearch(const AutocompleteRequest request,
|
|||
config, &cache);
|
||||
scope allocator = new ASTAllocator();
|
||||
RollbackAllocator rba;
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
|
||||
&rba, request.cursorPosition, moduleCache);
|
||||
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray,
|
||||
allocator.allocatorObject, &rba, request.cursorPosition, moduleCache);
|
||||
scope(exit) pair.destroy();
|
||||
|
||||
static struct SearchResults
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
module dcd.server.autocomplete.util;
|
||||
|
||||
import std.algorithm;
|
||||
import stdx.allocator;
|
||||
import std.experimental.allocator;
|
||||
import std.experimental.logger;
|
||||
import std.range;
|
||||
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.
|
||||
*/
|
||||
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)
|
||||
{
|
||||
const(Token)[] tokenArray;
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ import std.array;
|
|||
import std.conv;
|
||||
import std.datetime.stopwatch : AutoStart, StopWatch;
|
||||
import std.exception : enforce;
|
||||
import stdx.allocator;
|
||||
import stdx.allocator.mallocator;
|
||||
import std.experimental.allocator;
|
||||
import std.experimental.allocator.mallocator;
|
||||
import std.experimental.logger;
|
||||
import std.file;
|
||||
import std.getopt;
|
||||
|
|
@ -176,7 +176,7 @@ int runServer(string[] args)
|
|||
info("Sockets shut down.");
|
||||
}
|
||||
|
||||
ModuleCache cache = ModuleCache(new ASTAllocator);
|
||||
ModuleCache cache = ModuleCache(new ASTAllocator().allocatorObject);
|
||||
cache.addImportPaths(importPaths);
|
||||
infof("Import directories:\n %-(%s\n %)", cache.getImportPaths());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue