generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
JBRes-8425: Add memory for renaming transformations #41
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
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1244b2c
feat: Add `RenameMemory.kt`.
dragoi75 81a8b11
feat: Add `MemoryAwareTransformation` abstract class.
dragoi75 f88b12d
feat: Add `PsiSignatureGenerator`.
dragoi75 39fed91
feat: Modify `RenameVariableTransformation` to use memory.
dragoi75 d9a0a40
feat: Modify `RenameMethodTransformation` to use memory.
dragoi75 01ded7d
feat: Modify `RenameClassTransformation` to use memory.
dragoi75 00a2900
fix: only store signature if memory in write mode
dragoi75 38cfd16
fix: indentation
dragoi75 123fc9c
fix: remove repeat LLM calls.
dragoi75 9200771
fix: for nested modules, path should contain `src/` not only start with.
dragoi75 f49e543
fix: Update signature generation for methods
dragoi75 9e162bb
fix: reduce control flow complexity (remove `.also`)
dragoi75 0c4c9d1
fix: Subprojects were not indexed correctly
dragoi75 45471d9
fix: nitpicks
dragoi75 8047065
feat: abstract the `useMemory` flag from the `MemoryAwareTransformation`
dragoi75 128b06d
fix: simplify memory handling for rename transformations
dragoi75 84ee106
refactor: move signature generation logic to extension functions
dragoi75 20c8802
fix: remove unused import
dragoi75 18fba0c
feat: add configurable memory directory support for transformations
dragoi75 69c7d6b
feat: make `Memory` generic, not rename-specific
dragoi75 15d8db0
fix: nits
dragoi75 cb754db
fix: change memory from `File` to `Path`
dragoi75 7aac88c
refactor: simplify memory state initialization and access
dragoi75 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,5 @@ | |
| .kotlin | ||
| .qodana | ||
| build | ||
| codecocoon.yml | ||
| codecocoon.yml | ||
| .codecocoon-memory | ||
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
38 changes: 38 additions & 0 deletions
38
core/src/main/kotlin/com/github/pderakhshanfar/codecocoonplugin/memory/Memory.kt
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,38 @@ | ||
| package com.github.pderakhshanfar.codecocoonplugin.memory | ||
|
|
||
| /** | ||
| * Generic persistent storage interface for key-value pairs. | ||
| * | ||
| * Implements [AutoCloseable] to ensure automatic persistence on resource cleanup. | ||
| * Use with `.use {}` blocks to guarantee data is saved: | ||
| * | ||
| * ```kotlin | ||
| * PersistentMemory(projectName, memoryDir).use { memory -> | ||
| * memory.put("key", "value") | ||
| * // memory.save() called automatically on close | ||
| * } | ||
| * ``` | ||
| * | ||
| * @param K Key type | ||
| * @param V Value type | ||
| */ | ||
| interface Memory<K, V> : AutoCloseable { | ||
|
|
||
| /** | ||
| * Retrieves the value associated with the given key, or null if not found. | ||
| */ | ||
| fun get(key: K): V? | ||
|
|
||
| /** | ||
| * Puts a new key-value pair into the memory, returning the previous value if it existed. | ||
| */ | ||
| fun put(key: K, value: V): V? | ||
|
|
||
| fun size(): Int | ||
|
|
||
| fun save() | ||
|
|
||
| override fun close() { | ||
| save() | ||
| } | ||
| } | ||
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
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
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.