Use scope instead of std.typecons.scoped

This commit is contained in:
Per Nordlöw 2021-10-09 13:01:29 +02:00 committed by Jan Jurzitza
parent 02acaa534b
commit 5aba1b1b54
4 changed files with 7 additions and 7 deletions

View File

@ -213,7 +213,7 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, const(Token)[] tokenArray,
mixin(TYPE_IDENT_CASES);
case tok!")":
case tok!"]":
auto allocator = scoped!(ASTAllocator)();
scope allocator = new ASTAllocator();
RollbackAllocator rba;
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
&rba, cursorPosition, moduleCache);
@ -229,7 +229,7 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, const(Token)[] tokenArray,
case tok!";":
case tok!"}":
case tok!",":
auto allocator = scoped!(ASTAllocator)();
scope allocator = new ASTAllocator();
RollbackAllocator rba;
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
&rba, 1, moduleCache);
@ -302,7 +302,7 @@ AutocompleteResponse parenCompletion(T)(T beforeTokens,
case tok!")":
case tok!"]":
mixin(STRING_LITERAL_CASES);
auto allocator = scoped!(ASTAllocator)();
scope allocator = new ASTAllocator();
RollbackAllocator rba;
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
&rba, cursorPosition, moduleCache);

View File

@ -45,7 +45,7 @@ public AutocompleteResponse getDoc(const AutocompleteRequest request,
// trace("Getting doc comments");
AutocompleteResponse response;
RollbackAllocator rba;
auto allocator = scoped!(ASTAllocator)();
scope allocator = new ASTAllocator();
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
SymbolStuff stuff = getSymbolsForCompletion(request, CompletionType.ddoc,
allocator, &rba, cache, moduleCache);

View File

@ -45,7 +45,7 @@ public AutocompleteResponse findLocalUse(AutocompleteRequest request,
{
AutocompleteResponse response;
RollbackAllocator rba;
auto allocator = scoped!(ASTAllocator)();
scope allocator = new ASTAllocator();
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
// patchs the original request for the subsequent requests

View File

@ -47,7 +47,7 @@ public AutocompleteResponse findDeclaration(const AutocompleteRequest request,
{
AutocompleteResponse response;
RollbackAllocator rba;
auto allocator = scoped!(ASTAllocator)();
scope allocator = new ASTAllocator();
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
SymbolStuff stuff = getSymbolsForCompletion(request,
CompletionType.location, allocator, &rba, cache, moduleCache);
@ -75,7 +75,7 @@ public AutocompleteResponse symbolSearch(const AutocompleteRequest request,
auto cache = StringCache(request.sourceCode.length.optimalBucketCount);
const(Token)[] tokenArray = getTokensForParser(cast(ubyte[]) request.sourceCode,
config, &cache);
auto allocator = scoped!(ASTAllocator)();
scope allocator = new ASTAllocator();
RollbackAllocator rba;
ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator,
&rba, request.cursorPosition, moduleCache);