Skip to content

Commit

Permalink
Use sentence cache size from settings
Browse files Browse the repository at this point in the history
This also decreases the default from 10000 to 2000.
  • Loading branch information
valentjn committed Nov 10, 2019
1 parent 5630c73 commit 55f0bf8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 55f0bf8

Please sign in to comment.