From 5aba1b1b54ff683a5c3c0ac80a1c73655565500c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Sat, 9 Oct 2021 13:01:29 +0200 Subject: [PATCH] Use scope instead of std.typecons.scoped --- src/dcd/server/autocomplete/complete.d | 6 +++--- src/dcd/server/autocomplete/doc.d | 2 +- src/dcd/server/autocomplete/localuse.d | 2 +- src/dcd/server/autocomplete/symbols.d | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dcd/server/autocomplete/complete.d b/src/dcd/server/autocomplete/complete.d index e374866..c346e27 100644 --- a/src/dcd/server/autocomplete/complete.d +++ b/src/dcd/server/autocomplete/complete.d @@ -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); diff --git a/src/dcd/server/autocomplete/doc.d b/src/dcd/server/autocomplete/doc.d index 081062c..5d6ee3b 100644 --- a/src/dcd/server/autocomplete/doc.d +++ b/src/dcd/server/autocomplete/doc.d @@ -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); diff --git a/src/dcd/server/autocomplete/localuse.d b/src/dcd/server/autocomplete/localuse.d index ff50693..b3ab16c 100644 --- a/src/dcd/server/autocomplete/localuse.d +++ b/src/dcd/server/autocomplete/localuse.d @@ -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 diff --git a/src/dcd/server/autocomplete/symbols.d b/src/dcd/server/autocomplete/symbols.d index 55075e1..d06df7e 100644 --- a/src/dcd/server/autocomplete/symbols.d +++ b/src/dcd/server/autocomplete/symbols.d @@ -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);