From 502b91be487f970ff88071f93efa496f45ff5bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Mon, 20 Jun 2022 09:28:09 +0200 Subject: [PATCH] Use std.experimental.allocator in place of stdx.allocator --- .gitignore | 2 ++ build.bat | 5 ----- dsymbol | 2 +- dub.json | 5 ++--- libdparse | 2 +- makefile | 3 --- 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 ++-- src/dcd/server/autocomplete/util.d | 2 +- src/dcd/server/main.d | 6 +++--- stdx-allocator | 1 - 13 files changed, 17 insertions(+), 25 deletions(-) delete mode 160000 stdx-allocator diff --git a/.gitignore b/.gitignore index 5e9ad8b..faa125a 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ stdout.txt # Dub files .dub dub.selections.json + +dcd-test-library diff --git a/build.bat b/build.bat index 285502b..ee208cc 100644 --- a/build.bat +++ b/build.bat @@ -34,9 +34,6 @@ for /r "libdparse/src" %%F in (*.d) do call set libdparse_modules=%%libdparse_mo set msgspack_modules= 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 server_name=bin\dcd-server @@ -59,11 +56,9 @@ set server_name=bin\dcd-server %common_modules%^ %containers_modules%^ %msgspack_modules%^ - %stdx_allocator%^ -Icontainers/src^ -Imsgpack-d/src^ -Ilibdparse/src^ - -Istdx-allocator/source^ -wi -O -release^ -Jbin^ %MFLAGS%^ diff --git a/dsymbol b/dsymbol index f9a3d30..486668c 160000 --- a/dsymbol +++ b/dsymbol @@ -1 +1 @@ -Subproject commit f9a3d302527a9e50140991562648a147b6f5a78e +Subproject commit 486668c12364dc50f1fa59483d1c8d0c86e5f720 diff --git a/dub.json b/dub.json index 561e8e8..59f1bd9 100644 --- a/dub.json +++ b/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.13.1", + "libdparse": "~>0.19.3", ":common": "*", - "stdx-allocator": "~>2.77.5", "emsi_containers": "~>0.8.0" }, "subPackages": ["common"], diff --git a/libdparse b/libdparse index 1393ee4..c3fa4e6 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit 1393ee4d0c8e50011e641e06d64c429841fb3c2b +Subproject commit c3fa4e6eb3720c6aad9e9a772a919ccee2cf1215 diff --git a/makefile b/makefile index 0adeb83..6c5be13 100644 --- a/makefile +++ b/makefile @@ -12,7 +12,6 @@ LDC := ldc2 DPARSE_DIR := libdparse DSYMBOL_DIR := dsymbol -STDXALLOC_DIR := stdx-allocator SHELL:=/bin/bash @@ -65,7 +64,6 @@ SERVER_SRC := \ $(shell find common/src/dcd/common -name "*.d")\ $(shell find src/dcd/server -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 containers/src -name "*.d")\ $(shell find msgpack-d/src/ -name "*.d") @@ -74,7 +72,6 @@ DMD_SERVER_FLAGS := -Icontainers/src\ -Imsgpack-d/src\ -I${DPARSE_DIR}/src\ -I${DSYMBOL_DIR}/src\ - -I${STDXALLOC_DIR}/source\ -Jbin\ -wi\ -O\ diff --git a/src/dcd/server/autocomplete/complete.d b/src/dcd/server/autocomplete/complete.d index c346e27..ccab196 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!"]": - scope allocator = new ASTAllocator(); + scope allocator = new SymbolsAllocator(); 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!",": - scope allocator = new ASTAllocator(); + scope allocator = new SymbolsAllocator(); 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); - scope allocator = new ASTAllocator(); + scope allocator = new SymbolsAllocator(); 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 5d6ee3b..67f5408 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; - scope allocator = new ASTAllocator(); + scope allocator = new SymbolsAllocator(); 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 b3ab16c..e4cd82c 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; - scope allocator = new ASTAllocator(); + scope allocator = new SymbolsAllocator(); 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 d06df7e..0a72b0c 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; - scope allocator = new ASTAllocator(); + scope allocator = new SymbolsAllocator(); 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); - scope allocator = new ASTAllocator(); + scope allocator = new SymbolsAllocator(); RollbackAllocator rba; ScopeSymbolPair pair = generateAutocompleteTrees(tokenArray, allocator, &rba, request.cursorPosition, moduleCache); diff --git a/src/dcd/server/autocomplete/util.d b/src/dcd/server/autocomplete/util.d index 9bc6439..7744cfd 100644 --- a/src/dcd/server/autocomplete/util.d +++ b/src/dcd/server/autocomplete/util.d @@ -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; diff --git a/src/dcd/server/main.d b/src/dcd/server/main.d index ed31645..e635ef6 100644 --- a/src/dcd/server/main.d +++ b/src/dcd/server/main.d @@ -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 SymbolsAllocator); cache.addImportPaths(importPaths); infof("Import directories:\n %-(%s\n %)", cache.getImportPaths()); diff --git a/stdx-allocator b/stdx-allocator deleted file mode 160000 index d6e6ce4..0000000 --- a/stdx-allocator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d6e6ce4a838e0dad43ef13f050f96627339cdccd