diff --git a/src/main/java/org/bsplines/languagetool_languageserver/LanguageToolLanguageServer.java b/src/main/java/org/bsplines/languagetool_languageserver/LanguageToolLanguageServer.java index e234bd1a..b9cebe76 100644 --- a/src/main/java/org/bsplines/languagetool_languageserver/LanguageToolLanguageServer.java +++ b/src/main/java/org/bsplines/languagetool_languageserver/LanguageToolLanguageServer.java @@ -39,7 +39,6 @@ public class LanguageToolLanguageServer implements LanguageServer, LanguageClien private JLanguageTool languageTool; private Settings settings = new Settings(); - private static final long resultCacheMaxSize = 10000; private static final int resultCacheExpireAfterMinutes = 10; private static final String acceptSuggestionCodeActionKind = CodeActionKind.QuickFix + ".ltex.acceptSuggestion"; @@ -140,8 +139,8 @@ private void reinitialize() { String motherTongueShortCode = settings.getMotherTongueShortCode(); Language motherTongue = ((motherTongueShortCode != null) ? Languages.getLanguageForShortCode(motherTongueShortCode) : null); - ResultCache resultCache = new ResultCache(resultCacheMaxSize, resultCacheExpireAfterMinutes, - TimeUnit.MINUTES); + ResultCache resultCache = new ResultCache(settings.getSentenceCacheSize(), + resultCacheExpireAfterMinutes, TimeUnit.MINUTES); UserConfig userConfig = new UserConfig(settings.getDictionary()); languageTool = new JLanguageTool(language, motherTongue, resultCache, userConfig);