This commit is contained in:
ryuukk 2025-03-01 02:12:59 +01:00 committed by GitHub
commit 13aab1aef3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -149,6 +149,7 @@ struct ModuleCache
DSymbol* cacheModule(string location)
{
import std.stdio : File;
import core.memory: GC;
assert (location !is null);
@ -160,6 +161,8 @@ struct ModuleCache
if (!needsReparsing(cachedLocation))
return getEntryFor(cachedLocation).symbol;
scope(exit) GC.collect();
recursionGuard.insert(&cachedLocation.data[0]);
File f = File(cachedLocation);

View File

@ -65,6 +65,9 @@ enum CalltipHint {
public AutocompleteResponse complete(const AutocompleteRequest request,
ref ModuleCache moduleCache)
{
import core.memory: GC;
scope(exit) GC.collect();
const(Token)[] tokenArray;
auto stringCache = StringCache(request.sourceCode.length.optimalBucketCount);
auto beforeTokens = getTokensBeforeCursor(request.sourceCode,