1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2026-05-03 08:32:07 +02:00
Commit Graph

5723 Commits

Author SHA1 Message Date
Alex Plate
969b1a29aa Add IDEAVIM_WORKS_INTENTIONALLY_DIFFERENT skip reason for Neovim tests
This skip reason is for cases where IdeaVim intentionally deviates from
Neovim behavior to provide better user experience or IntelliJ integration.

The skip reason includes strict usage guidelines requiring clear evidence
(commit messages, code comments, or obvious cases) and mandatory description
explaining the intentional difference.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 23:30:18 +02:00
Alex Plate
5dcb345973 Set clipboard explicitly in tests test notification exists if no ideaput and test no notification if already was. 2026-01-03 23:30:17 +02:00
claude[bot]
868967fbed tests: Improve @TestWithoutNeovim descriptions in AddressTest
Replaced unclear "idk" description with specific explanation of the
behavioral difference between IdeaVim and Vim/Neovim. Added description
to testAllLinesRange to clarify the empty buffer handling difference.

These annotations now clearly document why the tests are excluded from
Neovim verification, making it easier for future maintainers to
understand the intentional behavioral differences.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 23:30:01 +02:00
claude[bot]
900a645a72 tests: Improve test content readability in MultipleCaretsTest
Replace meaningless "asdf", "qwer" strings with more descriptive words
like "code", "text", "value", "outer", "inner", etc. This makes the tests
more readable and easier to understand what's being tested.

Changes made:
- Inner/outer block angle tests: asdf -> name/type/value
- Inner/outer block backtick tests: asdf -> code
- Inner/outer block brace tests: asdf -> outer/inner/deep
- Inner/outer block bracket tests: asdf -> outer/inner/item
- Inner/outer block quote tests: asdf -> text/word
- Inner/outer block paren tests: asdf -> outer/inner/value
- Inner/outer block tag tests: asdf1/asdf2/asdf3/qwer -> div/span/em/text
- Outer paragraph test: asdf -> para
- Outer sentence test: asdf -> Sent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 23:07:36 +02:00
Alex Plate
375a8ec87e Add IDEAVIM_API_USED skip reason for Neovim tests
This skip reason is used when tests call IdeaVim API functions (both
public plugin API and internal API) that prevent proper Neovim state
synchronization. When these APIs are used directly in tests, we cannot
update the Neovim state accordingly, making test verification impossible.

Tests should only use VimTestCase functions for Neovim compatibility.

Updated the Tests Maintenance workflow to document this constraint,
clarifying that Neovim can only test methods using VimTestCase functions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 01:09:48 +02:00
Alex Plate
ae03184968 Remove @OptionTest mechanism from test infrastructure
The @OptionTest annotation system was designed to run tests with
multiple option combinations automatically. However, this mechanism
didn't gain popularity and didn't meet the desired criteria for
improving test coverage with different option values.

Tests now set options explicitly using enterCommand() calls, which
provides clearer test intent and simpler debugging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 00:56:00 +02:00
Alex Plate
09fe3c7e58 Fix: Return computed value in isNeovimTestingEnabled
The function was always returning true instead of the computed
neovimTestingEnabled value.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:27:55 +02:00
Alex Plate
071c36db14 Fix: Use testClass instead of javaClass in neovimEnabled
The neovimEnabled function was incorrectly using test.javaClass which
returns the class of the TestInfo object itself, not the actual test
class. This caused annotations like @TestWithoutNeovim on test classes
to be ignored.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:26:55 +02:00
Alex Plate
a6db9acd74 Refactor: Migrate VimIndentObject extension to new VimApi
Replace old ExtensionHandler/TextObjectActionHandler pattern with the
new api.textObjects {} DSL. The indentation-based text object algorithm
is preserved but now uses VimApi extension function.

- Use api.textObjects { register() } for ai, aI, ii text objects
- Replace TextRange with TextObjectRange.LineWise
- Remove IndentObject and IndentObjectHandler classes
- Reduce code from ~280 to ~188 lines

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:24:55 +02:00
Alex Plate
4624883df6 Refactor: Migrate VimIndentObject to Kotlin 2026-01-02 17:24:55 +02:00
Alex Plate
dfc82d59d4 Rename .java to .kt 2026-01-02 17:24:55 +02:00
Alex Plate
3e0b3f5598 Refactor: Migrate MiniAI extension to new VimApi
- Replace old VimExtensionFacade/ExtensionHandler pattern with
  VimApi.textObjects { register(...) } API
- Use Range.Simple from API module instead of internal TextRange
- Remove PortedMiniAiAction, addAction helper, and PLUG/KEY constants
- Simplify findQuoteRange and findBracketRange as VimApi extensions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:24:54 +02:00
Alex Plate
5c0ca43cf0 Refactor: Replace FLAG_TEXT_BLOCK with preserveSelectionAnchor property
Replace the FLAG_TEXT_BLOCK command flag with a more descriptive
`preserveSelectionAnchor` property in TextObjectActionHandler.

This property controls what happens when the selection anchor is outside
the target text object range in visual mode:
- true (default): extends selection from current anchor
- false: jumps to select only the text object

Commands like iw/aw preserve anchor (extend), while structural text
objects like i(/a(, i"/a", is/as reset anchor (jump).

Also adds comprehensive documentation with examples to both the
internal handler and the public API.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 16:28:22 +02:00
Alex Plate
3852b0b737 Fix(VIM-4105): a" a' a` text objects now include surrounding whitespace
Per Vim docs: "Any trailing white space is included, unless there is
none, then leading white space is included."

Previously IdeaVim only selected the quotes and content without any
surrounding whitespace.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 15:38:47 +02:00
Alex Plate
850c2272b7 Add optional lambda and return scope for chaining in VimApi
Make lambda parameters optional and return scope objects in:
- mappings(), textObjects(), outputPanel(), commandLine(), digraph()

This enables both lambda style and chained style usage:
- Lambda: mappings { nmap("jk", "<Esc>") }
- Chained: mappings().nmap("jk", "<Esc>")

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 11:11:18 +02:00
Alex Plate
76bd4387ac Add text object registration API to VimApi
Introduce TextObjectScope for registering custom text objects via the
plugin API. Text objects can be used with operators (d, c, y) or in
visual mode.

- Add TextObjectScope interface with register() method
- Add TextObjectRange sealed interface (CharacterWise/LineWise)
- Implement TextObjectScopeImpl using IdeaVim's internal mechanisms
- Migrate VimTextObjEntireExtension from Java to Kotlin using new API
- Add textObjects() function to VimApi

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 10:59:07 +02:00
claude[bot]
efacbb99b1 tests: Document @TestWithoutNeovim reasons in option mapper tests
Added description parameter to @TestWithoutNeovim annotations in
option mapper test classes to clarify why these tests are excluded
from Neovim verification. These tests verify integration between
IdeaVim options and IntelliJ's EditorSettingsExternalizable, which
is IDE-specific behavior not present in Neovim.

Modified files:
- ScrollOffOptionMapperTest
- SideScrollOffOptionMapperTest
- SideScrollOptionMapperTest
- ScrollJumpOptionMapperTest

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 09:32:55 +02:00
Alex Plate
82d4ef26e0 Refactor(VIM-2871): Migrate ParagraphMotion to new VimApi
Rewrite ParagraphMotion extension using the new VimApi DSL instead of
the legacy VimExtensionFacade API. The functionality remains identical.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 14:14:51 +01:00
Alex Plate
5c143e9951 Fix(VIM-4097): NextOccurrence ignores backslash in selected text
In very nomagic mode (\V), backslash still has special meaning and
introduces escape sequences. When selected text contained a backslash
(e.g., \IntegerField), it was interpreted as a regex atom instead of
a literal character.

The fix escapes backslashes in the search text before building the
pattern, ensuring literal matching.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 13:29:35 +01:00
Alex Plate
2a919ecc4f Simplify updateCaret to Vim-like behavior
Remove selection parameter from updateCaret - selection now extends
automatically if present, matching Vim's native cursor movement behavior.

- Remove selection: Range.Simple? parameter from updateCaret
- Add mode-aware range validation ([0, fileSize) vs [0, fileSize])
- Remove selection-related tests that are no longer applicable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 19:18:22 +02:00
Alex Plate
de2daf6ee5 Use normalized ranges for selection API
- Range.Simple and Range.Block now always have start <= end
- Document that ranges are normalized with exclusive end semantics
- Normalize Range.Block by using min/max on vimSelectionStart and offset
- Add tests verifying ranges are normalized regardless of selection direction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 15:24:58 +02:00
Alex Plate
f3de0d647d Refactor Range.Block API to use start/end offsets instead of array
Change Range.Block from storing an array of per-line ranges to using
simple start/end offsets, matching how block selection is stored
internally in VimBlockSelection. The conversion to per-line ranges
now happens internally in CaretTransactionImpl.

Changes:
- Range.Block now uses (start: Int, end: Int) like Range.Simple
- Add replaceTextBlockwise(Range.Block, String) overload for single text
- Update CaretReadImpl to return block start/end from primary caret
- Add blockToLineRanges() helper in CaretTransactionImpl
- Update ReplaceWithRegisterNewApi to use simplified API
- Add 17 new tests for block selection and replacement

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 15:24:57 +02:00
claude[bot]
b522f39358 Maintenance: ExitCommandTest - Expand test coverage for all command variants
Added comprehensive test coverage for all ExitCommand variants that were
previously untested. The ExitCommand implementation supports multiple
command aliases (qa/qall, xa/xall, wqa/wqall, quita/quitall), but the
test suite only covered qa and qall.

Changes:
- Added tests for xa and xall commands (exit all, with save)
- Added tests for wqa and wqall commands (write quit all)
- Added tests for quita and quitall commands (alternative quit all spelling)
- Added assertPluginError(false) checks to all tests to ensure commands
  execute without errors, following the pattern used in similar test files

This ensures all command variants are properly tested and prevents
regressions in any of the exit command aliases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 12:40:57 +02:00
Alex Plate
8ee28a3f10 Update the minimal supported intellij platform version to 253 2025-12-03 12:03:00 +02:00
Alex Plate
89c0d232f0 Update the tests for the 253 version 2025-11-22 00:58:27 +02:00
Alex Plate
559ca472ed Fix the tests for the 253 version 2025-11-22 00:43:08 +02:00
Alex Plate
35df913746 Remove the wrong test 2025-11-22 00:16:15 +02:00
Alex Plate
938e4acb22 Fix(VIM-4072): Do not log error when the source file doesn't exist
This is a normal situation, we can just show a warning in the log.
2025-11-22 00:16:15 +02:00
Matt Ellis
33adcd3f04 Add deepcopy() function 2025-11-22 00:09:32 +02:00
Matt Ellis
aa346a3dfa Add copy() function 2025-11-22 00:09:32 +02:00
Matt Ellis
ec13dd398b Ensure functions handle recursion and equality
Specifically, index() and count(). Moves the implementation of equality from EqualToHandler to VimDataType and friends
2025-11-22 00:09:32 +02:00
Matt Ellis
8b61d33c2c Improve not equal to operator support
List, Dictionary, Funcref and recursion
2025-11-22 00:09:32 +02:00
Matt Ellis
f062ceb898 Support equal to operator for Funcref 2025-11-22 00:09:32 +02:00
Matt Ellis
89115bdfb2 Support equal to operator for Dictionary 2025-11-22 00:09:32 +02:00
Matt Ellis
4baf80130f Support equal to operator for Lists 2025-11-22 00:09:32 +02:00
Matt Ellis
cede08b536 Support string output for recursive datatypes 2025-11-22 00:09:32 +02:00
Matt Ellis
1b7b1cb8ed Remove value semantics from VimList and Dictionary
Also VimFuncref. This is required to protect against unbounded recursion in generated equals and hashCode functions when the list or dictionary contains internally recursive references
2025-11-22 00:09:32 +02:00
Matt Ellis
28ec2ed694 Add comments and tests for Vim data types
Some tests are disabled, will implement next
2025-11-22 00:09:32 +02:00
Matt Ellis
c1c18c44ae Fix review comments for is operator 2025-11-22 00:09:32 +02:00
Alex Plate
378ae22863 Fix expansion of env variables for the options
Relates to VIM-2143
2025-11-21 23:48:43 +02:00
Alex Plate
5bb4a69d88 Fix(VIM-2143): Add env variables expansion for the source command 2025-11-21 23:48:42 +02:00
Alex Plate
2a56f50767 Fix(VIM-4073): Fix off-by-one error in inline element position check 2025-11-21 23:48:42 +02:00
claude[bot]
25a62d4ade Maintenance: IndexFunctionTest - Add comprehensive edge case tests
Add tests for previously uncovered edge cases in the index() function:
- Start index beyond list size
- Start index at list size boundary
- Negative start beyond list size
- Nested list comparisons
- Float value comparisons
- Float vs int type distinction
- ignoreCase parameter with non-string types

These tests ensure the implementation correctly handles boundary
conditions and type distinctions, improving test coverage and
preventing regressions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 15:34:19 +02:00
claude[bot]
50d0422b10 Fix tab selection after :tabclose command
The removeTabAt method was incorrectly passing indexToDelete twice
instead of using the indexToSelect parameter. This caused the wrong
tab to be selected after closing a tab.

The TabCloseCommand calculates which tab should be selected after
deletion (either index + 1 if closing current tab, or keep current
selection), but this information was being ignored.

This fix ensures the correct tab is selected after :tabclose, matching
expected Vim behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 15:32:47 +02:00
claude[bot]
595eae9476 Add test for DeleteToCaretAction edge case
Add test case for when caret is at the beginning of the command line
to ensure the action correctly handles this edge case without side effects.
This matches test coverage patterns in similar actions like
DeletePreviousWordActionTest and DeletePreviousCharActionTest.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 15:26:53 +02:00
Alex Plate
b01040fb44 Create a function for warn log with an exception 2025-11-21 15:16:25 +02:00
Alex Plate
a497270186 Fix an issue with function dict
This was originally found in https://github.com/JetBrains/ideavim/pull/1359
2025-11-21 15:16:03 +02:00
NaMinhyeok
034f968e98 revert CommandBuilder usage
Signed-off-by: NaMinhyeok <nmh9097@gmail.com>
2025-11-21 11:59:37 +02:00
NaMinhyeok
7efd050065 Enhance InsertExitModeAction to handle read-only files gracefully and ensure ESC functionality
Signed-off-by: NaMinhyeok <nmh9097@gmail.com>
2025-11-21 11:59:37 +02:00
NaMinhyeok
1b10943c6b Prevent entering insert mode in read-only files
Signed-off-by: NaMinhyeok <nmh9097@gmail.com>
2025-11-21 11:59:37 +02:00