-
Notifications
You must be signed in to change notification settings - Fork 117
Implement persistent disk cache with EhCache for TypoDiagnostic with WordStatus enum, separated cache managers, and tested EhCacheAdapter component #3550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nixel2007
merged 31 commits into
develop
from
copilot/implement-persistent-cache-typo-diagnostic
Nov 7, 2025
Merged
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
4817799
Implement persistent cache for TypoDiagnostic with CheckedWordsHolder
Copilot 2bfb4bb
Fix logging level and test robustness for CheckedWordsHolder
Copilot 44e01bb
Refactor CheckedWordsHolder to use WordStatus enum and let Spring Cac…
Copilot 8d9b280
Add persistent disk cache with EhCache + Caffeine composite cache
Copilot 1e26cd5
Refactor cache configuration: separate EhCache for typoCache, program…
Copilot 82b0f86
Add .bsl-ls-cache/ to .gitignore
Copilot 323c16c
Remove singleton pattern from EhCache manager, use proper Spring bean…
Copilot aac548e
Use Path.of(".") instead of System.getProperty("user.dir") for cache …
Copilot e8665c8
Address review feedback: increase heap size, improve test order, opti…
Copilot 9f5cd94
Fix code style: add proper imports and revert unnecessary caffeine co…
Copilot 889a4b9
Revert to original check logic pattern with putIfAbsent semantics
Copilot c5d516a
Remove putWordStatusIfAbsent method, use MISSING filter with putWordS…
Copilot bfef0d3
Fix test failures: unique cache directories per context and suppress …
Copilot a438ecf
Move EhCache logging config to application.properties and restore per…
Copilot 52800ab
Fix test failures: use unique cache directories per Spring context an…
Copilot b54a640
Move cache directory configuration to application.properties, remove …
Copilot 1c39d49
Rename cache property from bsl.typo.cache.dir to app.cache.path
Copilot 5a5aabe
Add automatic cleanup of test cache directories after test run
Copilot d63d4fe
Fix compilation error and unchecked cast warning in CacheConfiguration
Copilot 6804b8a
Add proper import for ValueRetrievalException
Copilot fdce260
Translate JavaDoc to Russian for consistency
Copilot 158cb9f
Remove javax.cache:cache-api dependency
nixel2007 b7ac4f1
Merge branch 'develop' into copilot/implement-persistent-cache-typo-d…
nixel2007 2ce8ea2
Merge branch 'develop' into copilot/implement-persistent-cache-typo-d…
nixel2007 467cfbc
Extract EhCache wrapper into separate component with tests
Copilot 28f2cc5
Refactor EhCacheAdapter initialization in tests
nixel2007 d36c235
Improve error handling in EhCacheAdapter tests
nixel2007 d9e745e
Translate comments and documentation in CheckedWordsHolder and WordSt…
nixel2007 104febc
Add persistent cache diagnostics section to Typo.md
nixel2007 3c93adf
Increase heap size in CacheConfiguration for improved performance
nixel2007 d8552f7
Fix QF
nixel2007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...in/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/typo/CheckedWordsHolder.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * This file is a part of BSL Language Server. | ||
| * | ||
| * Copyright (c) 2018-2025 | ||
| * Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors | ||
| * | ||
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| * | ||
| * BSL Language Server is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 3.0 of the License, or (at your option) any later version. | ||
| * | ||
| * BSL Language Server is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with BSL Language Server. | ||
| */ | ||
| package com.github._1c_syntax.bsl.languageserver.diagnostics.typo; | ||
|
|
||
| import org.springframework.cache.annotation.CachePut; | ||
| import org.springframework.cache.annotation.Cacheable; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| /** | ||
| * Component for managing persistent cache of checked words for typo diagnostic. | ||
| * Uses Spring Cache with EhCache for persistent disk storage. | ||
| */ | ||
| @Component | ||
| public class CheckedWordsHolder { | ||
|
|
||
| /** | ||
| * Get the status of a word from cache. | ||
| * | ||
| * @param lang language code ("en" or "ru") | ||
| * @param word the word to get status for | ||
| * @return WordStatus indicating if the word has an error, no error, or is missing from cache | ||
| */ | ||
| @Cacheable(value = "typoCache", key = "#lang + ':' + #word", cacheManager = "typoCacheManager") | ||
| public WordStatus getWordStatus(String lang, String word) { | ||
| return WordStatus.MISSING; | ||
| } | ||
|
|
||
| /** | ||
| * Store the status of a word in the cache. | ||
| * | ||
| * @param lang language code ("en" or "ru") | ||
| * @param word the word to store status for | ||
| * @param hasError true if the word has a typo, false otherwise | ||
| * @return the stored WordStatus | ||
| */ | ||
| @CachePut(value = "typoCache", key = "#lang + ':' + #word", cacheManager = "typoCacheManager") | ||
| public WordStatus putWordStatus(String lang, String word, boolean hasError) { | ||
| return hasError ? WordStatus.HAS_ERROR : WordStatus.NO_ERROR; | ||
| } | ||
| } |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/typo/WordStatus.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * This file is a part of BSL Language Server. | ||
| * | ||
| * Copyright (c) 2018-2025 | ||
| * Alexey Sosnoviy <[email protected]>, Nikita Fedkin <[email protected]> and contributors | ||
| * | ||
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| * | ||
| * BSL Language Server is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 3.0 of the License, or (at your option) any later version. | ||
| * | ||
| * BSL Language Server is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with BSL Language Server. | ||
| */ | ||
| package com.github._1c_syntax.bsl.languageserver.diagnostics.typo; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| /** | ||
| * Status of a word's spell check result. | ||
| */ | ||
| public enum WordStatus implements Serializable { | ||
| /** | ||
| * Word has a spelling error. | ||
| */ | ||
| HAS_ERROR, | ||
|
|
||
| /** | ||
| * Word is spelled correctly. | ||
| */ | ||
| NO_ERROR, | ||
|
|
||
| /** | ||
| * Word has not been checked yet. | ||
| */ | ||
| MISSING | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.