Update to dparse 0.10.x

This commit is contained in:
Basile Burg 2018-11-06 09:15:40 +01:00
parent 34e79e0f1b
commit 9b7414367d
7 changed files with 10 additions and 10 deletions

@ -1 +1 @@
Subproject commit 47f471114ad272dc0cd41996c7977413d7a68d63 Subproject commit b3b4616601ff4dad529b5acf927aaf85c21559a2

View File

@ -7,8 +7,8 @@
], ],
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"dsymbol": "~>0.4.8", "dsymbol": "~>0.5.2",
"libdparse": "~>0.9.9", "libdparse": "~>0.10.6",
"msgpack-d": "~>1.0.0-beta.3", "msgpack-d": "~>1.0.0-beta.3",
"stdx-allocator": "~>2.77.4" "stdx-allocator": "~>2.77.4"
}, },

@ -1 +1 @@
Subproject commit 95444a966923a24098c31464e09a7096208da155 Subproject commit 6a1c48f8bdc6e8bb890039aa67c03a4910b55d65

View File

@ -54,7 +54,7 @@ public AutocompleteResponse complete(const AutocompleteRequest request,
ref ModuleCache moduleCache) ref ModuleCache moduleCache)
{ {
const(Token)[] tokenArray; const(Token)[] tokenArray;
auto stringCache = StringCache(StringCache.defaultBucketCount); auto stringCache = StringCache(request.sourceCode.length.optimalBucketCount);
auto beforeTokens = getTokensBeforeCursor(request.sourceCode, auto beforeTokens = getTokensBeforeCursor(request.sourceCode,
request.cursorPosition, stringCache, tokenArray); request.cursorPosition, stringCache, tokenArray);

View File

@ -46,7 +46,7 @@ public AutocompleteResponse getDoc(const AutocompleteRequest request,
AutocompleteResponse response; AutocompleteResponse response;
RollbackAllocator rba; RollbackAllocator rba;
auto allocator = scoped!(ASTAllocator)(); auto allocator = scoped!(ASTAllocator)();
auto cache = StringCache(StringCache.defaultBucketCount); auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.ddoc, SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.ddoc,
allocator, &rba, cache, moduleCache); allocator, &rba, cache, moduleCache);
if (stuff.symbols.length == 0) if (stuff.symbols.length == 0)

View File

@ -46,7 +46,7 @@ public AutocompleteResponse findLocalUse(AutocompleteRequest request,
AutocompleteResponse response; AutocompleteResponse response;
RollbackAllocator rba; RollbackAllocator rba;
auto allocator = scoped!(ASTAllocator)(); auto allocator = scoped!(ASTAllocator)();
auto cache = StringCache(StringCache.defaultBucketCount); auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
// patchs the original request for the subsequent requests // patchs the original request for the subsequent requests
request.kind = RequestKind.symbolLocation; request.kind = RequestKind.symbolLocation;

View File

@ -48,7 +48,7 @@ public AutocompleteResponse findDeclaration(const AutocompleteRequest request,
AutocompleteResponse response; AutocompleteResponse response;
RollbackAllocator rba; RollbackAllocator rba;
auto allocator = scoped!(ASTAllocator)(); auto allocator = scoped!(ASTAllocator)();
auto cache = StringCache(StringCache.defaultBucketCount); auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
SymbolStuff stuff = getSymbolsForCompletion(request, SymbolStuff stuff = getSymbolsForCompletion(request,
CompletionType.location, allocator, &rba, cache, moduleCache); CompletionType.location, allocator, &rba, cache, moduleCache);
scope(exit) stuff.destroy(); scope(exit) stuff.destroy();
@ -72,7 +72,7 @@ public AutocompleteResponse symbolSearch(const AutocompleteRequest request,
LexerConfig config; LexerConfig config;
config.fileName = ""; config.fileName = "";
auto cache = StringCache(StringCache.defaultBucketCount); auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
const(Token)[] tokenArray = getTokensForParser(cast(ubyte[]) request.sourceCode, const(Token)[] tokenArray = getTokensForParser(cast(ubyte[]) request.sourceCode,
config, &cache); config, &cache);
auto allocator = scoped!(ASTAllocator)(); auto allocator = scoped!(ASTAllocator)();