1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2026-03-28 05:52:37 +01:00
Commit Graph

5696 Commits

Author SHA1 Message Date
Matt Ellis
5d4dd891e6 Add List+Dictionary extendnew() function 2026-01-09 19:12:27 +02:00
Matt Ellis
f27cafbae3 Add List+Dictionary extend() function 2026-01-09 19:12:27 +02:00
Matt Ellis
e1ddf7780f Add List+String slice() function 2026-01-09 19:12:27 +02:00
Matt Ellis
4103291d1a Add List+Dictionary+String items() function 2026-01-09 19:12:27 +02:00
Matt Ellis
727b94e6ff Add Dictionary values() function 2026-01-09 19:12:27 +02:00
Matt Ellis
d07a154a77 Add Dictionary keys() function 2026-01-09 19:12:27 +02:00
Matt Ellis
94736d2339 Add List+Dictionary remove() function 2026-01-09 19:12:27 +02:00
Matt Ellis
dc335e5178 Add List insert() function 2026-01-09 19:12:27 +02:00
Matt Ellis
52a1774f11 Add Dictionary has_key() function 2026-01-09 19:12:27 +02:00
Matt Ellis
6f553ec3c0 Add List add() function 2026-01-09 19:12:27 +02:00
Matt Ellis
ed50fa28f5 Refactor argument handling for functions 2026-01-09 19:12:27 +02:00
Matt Ellis
0e2349baac Refactor min/max args for function handler 2026-01-09 19:12:27 +02:00
Matt Ellis
fa06644ece Move functions to more appropriate packages 2026-01-09 19:12:27 +02:00
Alex Plate
7d8655a624 Add tests for replace with register inside empty brackets
Tests for VIM-3798: replacing inside empty braces, quotes, parentheses,
and square brackets.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:05:42 +02:00
Alex Plate
799d450886 Update plugin description with more detailed feature information
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 16:53:04 +02:00
Alex Plate
63275de20b Add NEOVIM_RPC_SPECIAL_KEYS_INSERT_MODE reason for clearer test documentation
Replace UNCLEAR annotations with a properly documented reason explaining why backspace and other special keys fail in Neovim RPC testing. This makes the limitation clear for future developers and consolidates 8 tests under a single, well-explained reason.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-08 17:15:58 +02:00
Matt Ellis
8f7f27caec Fix high CPU usage while showing command line
Fixes repeatedly calling repaint while trying to paint the caret. This is due to a combination of the modelToView translation returning a location instead of a bounding box (the width can be zero) and a check that one rectangle contains another returning false when one rectangle has a width of zero.

Also fixes the caret not redrawing properly while flashing when first shown. This is due to the width and height not being properly initialised.
2026-01-06 10:15:56 +02:00
Alex Plate
8805ddac37 Update tests with refined skip reasons and add @VimBehaviorDiffers annotations
- Use `INTELLIJ_PLATFORM_INHERITED_DIFFERENCE` for skip reasons where IntelliJ Platform constraints lead to behavioral differences with Neovim.
- Introduce `@VimBehaviorDiffers` for reverse search test, providing a detailed description of the behavior and marking it for investigation.
2026-01-05 09:43:59 +02:00
Alex Plate
1f9528a38a Add marks verification to Neovim tests
- Implement comprehensive marks verification checking local (a-z),
  global (A-Z), numbered (0-9), and special marks (<>'^")
- Add ignoredMarks configuration to allow test-specific exclusions
- Exclude '[' and ']' (change marks) from verification due to
  VIM-4107: undo behavior differs between IdeaVim and Neovim
- Add test documenting the change marks undo behavior difference

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-04 00:19:27 +02:00
Alex Plate
db3eb3a006 Add SEE_DESCRIPTION skip reason and remove PLUG
Introduces SEE_DESCRIPTION as a catch-all SkipNeovimReason for
case-specific differences that don't fit standard categories. This
reason requires a mandatory description parameter explaining why
the test cannot be compared with Neovim.

Removes the PLUG reason and replaces its only usage in testPlugMapping
with SEE_DESCRIPTION, explaining that Neovim represents <Plug> as a
single character, causing map state comparison failures.

Updates tests-maintenance skill documentation to reflect the new reason
and its usage guidelines.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 23:45:22 +02:00
Alex Plate
21d72b150f Use INTELLIJ_PLATFORM_INHERITED_DIFFERENCE for testAllLinesRange
The test verifies behavior where deleting all lines results in an empty
buffer in IdeaVim, while Neovim always maintains at least one newline
character. This difference is inherited from the IntelliJ Platform's
editor implementation, which allows completely empty editors.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 23:31:53 +02:00
Alex Plate
46b4e1f600 Clarify description in @TestWithoutNeovim annotation to specify deleted line range 2026-01-03 23:30:50 +02:00
Alex Plate
e2c86e9eda Add INTELLIJ_PLATFORM_INHERITED_DIFFERENCE skip reason for Neovim tests
This skip reason is for cases where IdeaVim behavior differs from Neovim due
to constraints or design decisions inherited from the IntelliJ Platform.

Examples include:
- Empty buffer handling: Platform editors can be empty while Neovim buffers
  always contain at least one newline character
- Position/offset calculations for newline characters
- Line/column indexing differences

The description parameter is mandatory and must explain what Platform behavior
causes the difference and how it manifests in the test.

🤖 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
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