Commit Graph
100 Commits
Author SHA1 Message Date
Alex Plate bdc29c3eb4 Add support for count(), index(), min(), max(), and range() vimscript functions
Implements five new vimscript list functions:
- count(): counts occurrences of a value in a list/dict
- index(): finds first index of a value in a list
- min()/max(): finds minimum/maximum value in a list/dict
- range(): generates a list of numbers with optional stride

Includes error handling for edge cases like zero stride and invalid ranges.
2025-10-03 20:59:29 +03:00
Alex Plate d46eb39635 Add support for repeat(), char2nr(), nr2char(), trim(), and reverse() vimscript functions
Implement five commonly used vimscript functions:

- repeat(expr, count): Repeats strings or lists multiple times
- char2nr(char): Converts character to Unicode code point
- nr2char(number): Converts code point to character
- trim(text, [mask], [dir]): Trims whitespace or custom characters
- reverse(object): Reverses lists in-place or returns reversed string

All functions include comprehensive test coverage and follow vim's
official behavior including edge cases.
2025-10-03 19:08:57 +03:00
Alex Plate a6c71d90bb Fix(VIM-4050): Implement getline vim function 2025-10-03 18:41:34 +03:00
Alex Plate 62de460264 Execute the processor with a proper mode after closing the exEntryPanel
Now, the inputProcessor will be called after all closing is finished. This includes the mode that won't be CMD_LINE anymore, but the one that was used before entering CMD_LINE
2025-10-03 15:33:27 +03:00
Alex Plate 2d02327665 Rename method to get the panel
Kotlin has some hard incremental compilation issues when keeping the old name. No other reason for the rename
2025-10-03 15:32:53 +03:00
Alex Plate 91b5a705d4 Fix issues with null variables during swing initialization 2025-10-03 15:16:04 +03:00
Alex Plate b7c3bc2875 Migrate ExOutputPanel from Java to Kotlin and update related references 2025-10-03 13:30:20 +03:00
Alex Plate 70922f5fc5 Rename .java to .kt 2025-10-03 13:30:19 +03:00
Alex Plate 13e4d0ce2b Migrate ExTextField from Java to Kotlin and update related references 2025-10-03 13:30:19 +03:00
Alex Plate 3990b6475e Rename .java to .kt 2025-10-03 13:30:19 +03:00
Alex Plate 63c65c8b93 Migrate ExEntryPanel from Java to Kotlin and update related references 2025-10-03 13:30:19 +03:00
Alex Plate ba2ffa6955 Rename .java to .kt 2025-10-03 13:30:19 +03:00
Alex Plate 411b6eaf48 Refactor ExDocument: Migrate from Java to Kotlin 2025-10-03 13:30:18 +03:00
Alex Plate b5ecb05382 Rename .java to .kt 2025-10-03 13:30:18 +03:00
Alex Plate 330f24bf74 Update JUnit to version 6 and improve null safety in test utilities 2025-10-02 18:04:30 +03:00
Alex Plate 36dfce695a Fix the compatibility with the latest idea EAP 2025-10-02 17:55:55 +03:00
Alex Plate 168fa309ae Add an instruction that an external plugin should be installed 2025-10-02 17:07:24 +03:00
Alex Plate 2c6638fe37 Introduce a common getChar implementation in the injector 2025-10-02 17:05:06 +03:00
Alex Plate 59459e5113 Introduce a hidden vimhints option to hide the new hints functionality 2025-09-10 14:58:46 +03:00
Alex Plate 54653d1d1b Specify ActionUpdateThread for ToggleHintsAction 2025-09-10 14:06:33 +03:00
Alex Plate 8aedadde5e [API] Use the new API for implementation of the ReplaceWithRegister 2025-09-05 17:54:25 +03:00
Alex Plate 763d4518eb Refactor: Replace deprecated fileSize property 2025-09-05 16:53:45 +03:00
Alex Plate f5c1b11e4f [API] Rename Read to EditorAccessor 2025-09-05 16:51:06 +03:00
Alex Plate e9bc665aaa Revert StatusBarWidgetsManager to be the project-level service 2025-09-05 10:43:25 +03:00
Alex Plate 0fd95c17cf Fix(VIM-4028): Disable new plugin registration because currently it causes an error and this should be properly reviewed 2025-09-05 10:38:30 +03:00
Alex Plate 1c80863e12 Fix an issue that the application level service was called from the project level 2025-09-02 11:27:22 +03:00
Alex Plate ec11c2ec70 Update status bar menu links with a sign that shows that this is an external link
Because of some encoding issues, I had to embed the string right in the code
2025-09-02 11:25:55 +03:00
Alex Plate 1e98fe2bed Add link to IdeaVim documentation in the status bar menu 2025-09-02 11:22:10 +03:00
Alex Plate 7558a9da39 Spellchecker is a separate plugin now and needs to be declared explicitly 2025-09-02 11:12:57 +03:00
Alex Plate b47783090c Add new plugins for compatibility checks in TeamCity and plugin dependency validation. 2025-09-01 10:00:55 +03:00
Alex Plate 1c6e9354fb Add instruction to examine commit content, not just messages
- Emphasize using git show to see full commit content
- Note that test files contain good examples for changelog
- Encourage looking at actual code changes for better understanding
- Help find specific command examples from tests
2025-08-30 11:57:20 +03:00
Alex Plate 2bc5daf2bf Add instruction to read PR comments for changelog guidance
- Emphasize reading PR comments from previous changelog updates
- Add gh command to view PR comments
- Note that review feedback may indicate what to avoid
- Help ensure special instructions from PR discussions are followed
2025-08-30 11:56:42 +03:00
Alex Plate 8e7beea33e Add note about reading only top portion of CHANGES.md
- Clarify that CHANGES.md is a large file
- Instruct to focus on [To Be Released] section and recent versions
- Avoid reading the entire file unnecessarily
2025-08-30 11:55:21 +03:00
Alex Plate 8b9e904623 Add dedicated section for updating changeNotes in build.gradle.kts
- Create separate section with detailed instructions for changeNotes
- Clarify that content should match CHANGES.md exactly (no summarizing)
- Provide HTML formatting guidelines and examples
- Emphasize not to create shorter or condensed versions
- Include example showing Markdown to HTML conversion
2025-08-30 11:19:59 +03:00
Alex Plate ed14efc55c Add instruction to use PR titles as-is in changelog
- Specify that PR descriptions should be taken directly from PR titles
- Don't regenerate or rewrite PR descriptions
- Maintain author's original wording for PR entries
2025-08-30 11:11:40 +03:00
Alex Plate deae5fea8e Add special rules for Merged PRs section in changelog
- Clarify that PRs have different inclusion criteria than Features/Fixes
- Note that internal changes and refactoring PRs should be included
- Emphasize acknowledging community contributions regardless of visibility
- Make clear that "user-visible only" rule doesn't apply to PRs section
2025-08-30 11:10:27 +03:00
Alex Plate f5c5bd82ba Add another example of unclear changelog entry to avoid
- Add "Fixed inlay offset calculations" as bad example
- Show better alternative with specific user-visible case
- Reinforce that technical internal fixes should either have clear user impact or be omitted
2025-08-30 11:09:02 +03:00
Alex Plate 3b88a57478 Add guidance for clear, specific changelog entries
- Include bad example: "Fixed count validation in text objects" (too vague)
- Show better alternative: specific command that was fixed
- Emphasize: if unable to determine specific case, omit entry rather than be unclear
- Help ensure all changelog entries are meaningful to users
2025-08-30 11:07:13 +03:00
Alex Plate 00d08c3840 Add instructions to avoid duplication in changelog subsections
- Clarify that each change should appear in only ONE subsection
- Add note that features can also use YouTrack link format
- Emphasize no duplication between Features, Fixes, and other categories
- Update both Format Notes and Writing Style sections for clarity
2025-08-30 11:04:57 +03:00
Alex Plate a5dd8cf8b1 Update PR title format for changelog updates
- Change PR title format to "Update changelog: <super short summary>"
- Add example showing how to summarize key changes in title
- Update both GitHub workflow and changelog instructions for consistency
2025-08-30 10:55:54 +03:00
Alex Plate 22b17e8cc5 Add instruction to include helpful documentation links in changelog
- Guide to search for and include official documentation links
- Add links to JetBrains features and Vim commands when relevant
- Include examples showing linked IntelliJ features (Next Edit Suggestion, multiple cursors)
- Help users find more information about mentioned features
2025-08-30 10:54:16 +03:00
Alex Plate 070b608687 Add guidance for including command examples in changelog
- Add instruction to include examples of commands/operations in changelog entries
- Update example entries to demonstrate including specific commands
- Show how to describe what now works for both fixes and features
- Help users understand how to use new features or what was fixed
2025-08-30 10:51:34 +03:00
Alex Plate a72db2b5af Add user-focus emphasis to changelog instructions
- Clarify that internal code changes should not be logged
- Emphasize that changelog is for users, not developers
- Strengthen user-focused writing style guidelines
- Exclude refactoring, code cleanup, and internal architecture changes
2025-08-30 10:49:20 +03:00
Alex Plate 9f58c73d92 Refactor documentation structure and extract changelog instructions
- Simplified CLAUDE.md to avoid redundancy with other docs
- Created .claude/changelog-instructions.md with detailed changelog maintenance guide
- Updated GitHub Action to reference the new changelog instructions doc
- Added instructions for updating changeNotes in build.gradle.kts
- Added notes about excluding API module changes (experimental status)
- Added step to check previous changelog PRs for special instructions
2025-08-30 10:42:01 +03:00
Alex Plate 0b919b18b7 [API] Fix handling of empty strings in list option functions
The append, prepend, and remove functions now correctly handle empty
option values. When an option is empty (""), we use an empty list
instead of splitting the empty string which would result in [""].

This fixes test failures in OptionScopeTest for operations on empty options.
2025-08-29 19:00:37 +03:00
Alex Plate 9aff700a58 Add GitHub Action for automated changelog maintenance using Claude
This workflow runs daily at 5 AM UTC (or manually) and uses Claude to:
- Review commits and update CHANGES.md with meaningful changes
- Maintain the exact format used before the changelog gap
- Include YouTrack links for fixes (format: [VIM-XXXX](url))
- Reference merged PRs (excluding dependabot and Claude PRs)
- Handle the historical gap between versions 2.9.0 and 2.28.0
- Create PRs only when there are actual changes to document

Claude has access to git, GitHub CLI, and can fetch from YouTrack,
GitHub, and JetBrains plugin pages to gather accurate information.
2025-08-29 18:32:17 +03:00
Alex Plate 12fe8671d3 Add GitHub Action to automatically update IntelliJ version configurations
This workflow runs three times a year (August 15, April 30, December 1)
and uses Claude to check if new IntelliJ versions need to be added to
TeamCity test configurations. Claude will automatically create a PR if
a new version is needed.

The workflow can also be triggered manually for testing.
2025-08-29 18:11:27 +03:00
Alex Plate fc2cea471b Add TeamCity configuration for IntelliJ 2025.2
Added test configuration for IntelliJ 2025.2 to run alongside 2025.1.
This ensures compatibility testing with the upcoming IDE version.
2025-08-29 18:11:27 +03:00
Alex Plate 9499716b18 [API] Simplify list option handling in OptionScope 2025-08-29 18:11:27 +03:00
Alex Plate c66a212781 [API] Add experimental API warning to all plugin documentation
Added prominent warning notice to all Plugin API documentation files:
- Plugin-API-reference.md
- Plugin-API-introduction.md
- Plugin-API-quick-start-guide.md
- Plugin-API-tutorial-replace-with-register.md

The warning clearly states that the API is experimental and not
recommended for production use, with potential breaking changes.
2025-08-29 18:11:26 +03:00
Alex Plate 0099ea9073 [API] Update Plugin API Reference documentation for OptionScope
- Document that option() function now returns a value
- Add comprehensive documentation for list option methods (append, prepend, remove)
- Add utility methods documentation (toggle, split)
- Include practical usage examples and common use cases
- Update method signatures to reflect non-nullable returns
- Add Vim command equivalents for better understanding
2025-08-29 18:11:26 +03:00
Alex Plate de809b528b [API] Turn OptionScopeImpl into an object 2025-08-29 18:11:26 +03:00
Alex Plate c6adc48e81 [API] Make option() function return a value
This allows users to easily retrieve values from option scope:
val x = option { get<Int>("history") }

- Changed option() signature from Unit to generic T return type
- Updated VimApiImpl implementation to return the lambda result
- Added test demonstrating the new return value capability
2025-08-29 18:11:26 +03:00
Alex Plate 955ccc8151 [API] Make getOptionValue return type non-nullable
The implementation always returns a value or throws an exception,
so the return type should be non-nullable to reflect this behavior.
Updated extension functions to remove unnecessary null checks.
2025-08-29 18:11:26 +03:00
Alex Plate 907495df4d [API] Refactor OptionScope from abstract class to interface
- Convert OptionScope from abstract class to interface
- Extract inline functions with reified types as extension functions
- Make getOptionValue() and setOption() public interface methods
- Remove internal modifier layer functions
- Update OptionScopeImpl to implement new interface
- Add documentation recommending extension function usage
- Update test imports to use new extension functions
2025-08-29 18:11:25 +03:00
Alex Plate 2b276d316f [API] Add append(), prepend(), and remove() extension functions for list options
- append(): adds values to end of comma-separated list (like Vim's +=)
- prepend(): adds values to beginning of list (like Vim's ^=)
- remove(): removes values from list (like Vim's -=)
- All functions prevent duplicate values from being added
- Comprehensive test coverage for all scenarios
2025-08-29 18:11:25 +03:00
Alex Plate 4f1982d6bd [API] Add toggle() function to OptionScope for boolean options
Adds a simple toggle() function that flips boolean option values.
Works with both full option names and abbreviations.

Example usage:
  toggle("ignorecase")  // true → false, false → true
  toggle("ic")          // works with abbreviations
2025-08-29 18:11:25 +03:00
Alex Plate a235648672 [API] Add split() extension function to OptionScope for comma-separated values
Adds a concise String.split() extension function within OptionScope that splits
comma-separated option values into lists. This simplifies working with list-type
options like 'virtualedit', 'whichwrap', etc.

Example usage:
  val values = get<String>("virtualedit")?.split() ?: emptyList()
  // "block,all" → ["block", "all"]
2025-08-29 18:11:25 +03:00
Alex Plate 85d5da4ab6 [API] Add comprehensive tests for OptionScope API
Added extensive test coverage for the OptionScope API including:
- String list options with various formats (single, multiple, empty values)
- Error handling for invalid values, empty names, and type mismatches
- Boundary conditions for integer options
- Boolean/integer type conversions
- Global vs local option scoping
- Option abbreviations
- Edge cases like trailing/leading commas and very long strings
2025-08-29 18:11:24 +03:00
Alex Plate df82794f4f Fixed a missing | 2025-08-29 14:31:44 +03:00
Alex Plate 2d378327e7 Fix tests after bringing back the old ReplaceWithRegister 2025-08-29 14:00:24 +03:00
Alex Plate 0e37295988 Ignore some test for neovim 2025-08-29 13:55:27 +03:00
Alex Plate 0d342ea6c3 Disable the new ReplaceWithRegister test as it's flaky 2025-08-29 13:45:06 +03:00
Alex Plate e343da03a1 Bring back the old implementation of the replace with register
The new implementation is now named ReplaceWithRegisterNew
2025-08-29 13:44:26 +03:00
Alex Plate 476389b9c3 Bring back actualText to keep the compatibility with an external plugin 2025-08-29 11:48:26 +03:00
Alex Plate 7e71676656 [API] The write lock should be taken on EDT 2025-08-29 11:45:22 +03:00
Alex Plate 6a149a8ba4 [API] Add an experimental status on the API 2025-08-29 11:45:22 +03:00
Alex Plate 186db70a22 [API] Specify and cleanup the error handling in the option scope
1) ExException is wrapped with the IllegalArgumentException. We cannot use the raw ExException as it's not defined in the API module. So, if any client will have an access only to the API module, they won't be able to handle this kind of the exception.

2) getOption throws IllegalArgumentException if the type classifier is null. I don't know when this might happen, but this looks more like a plugin developer error. Also, this allows to distinguish the wrong option name vs this type of problem

3) In setOption and getOption throw an exception if there is no such option. This clearly explains what is wrong with this call.

Note: there was a question of using exceptions vs some return values, even like `Result`. The decision falls into the using of exceptions as using the wrong arguments in the plugin is a programming error from the user point of view.
This means, if there is a plugin that checks some option that in reality doesn't exist, it's not a fail of the end user and the end user cannot do anything about that.
Also, using the `Result` will force the plugin developer to handle all possible failure branches, what is quite unnecessary when accessing a well-defined option.
2025-08-22 17:52:51 +03:00
Alex Plate 04d9282fb2 Change OutputPanelScopeImpl to be an object 2025-08-22 16:30:51 +03:00
Alex Plate 6f54a30bc3 Fix(VIM-4004): Add support for f13-f24 keys 2025-08-22 16:09:43 +03:00
Alex Plate a0a3f3f3b1 Fix an exception during the renaming: there was a read action missing 2025-08-22 11:22:38 +03:00
Alex Plate aa539e76eb Rename RWLockLabel to VimLockLabel and other annotations
Also, clarify their usage
2025-08-22 11:22:38 +03:00
Alex Plate 55dd27db33 Update the contribution guide to avoid the confusion
By feedback https://github.com/JetBrains/ideavim/pull/1271#issuecomment-3203657519
2025-08-20 09:37:06 +03:00
Alex Plate 2136836877 Merge all configuration files into a single plugin.xml
The way we split plugin.xml was outdated. Also, it started to show errors in highlighting, even there were no errors.
It's better to keep everything in a single file
2025-08-20 09:18:16 +03:00
Alex Plate 63e482408d Fix compilation issues 2025-08-08 18:28:52 +03:00
Alex Plate ddb4c5ec81 Comment out listeners scope. It does require an accurate and proper review and design 2025-08-08 18:07:59 +03:00
Alex Plate 22e6ba3b3c Refactor DigraphScopeImpl to be an object and simplify digraph method logic 2025-08-08 18:04:09 +03:00
Alex Plate e2a089fbeb Remove function to clearing all custom digraphs
This function is not provided by vim and by using it from the plugins we may drop the digraphs created by other plugins.
It'd be better to provide a just remove function. However, let's skip it for now. Also, maybe we should use an approach with the owners
2025-08-08 18:00:30 +03:00
Alex Plate 5cfed9929e Refresh documentation for MappingScope 2025-08-08 17:43:00 +03:00
Alex Plate e85c006321 Remove isRepeatable parameter from key mapping methods
First of all, this is a property of the plugin, not the mapping. Secondly, all plugins should support repeat.
2025-08-08 17:11:10 +03:00
Alex Plate 1db8d01961 Add detailed documentation for label usage in key mapping methods
Documented the role of `label` in providing intermediate mappings, allowing users to override default plugin mappings with custom configurations.
2025-08-08 16:23:37 +03:00
Alex Plate 9c9cd1b2a0 Bring back the function to set the mode, but in experimental status now 2025-08-08 14:28:01 +03:00
Alex Plate fb6a97f586 Remove redundant return statement in CommandLineScope 2025-08-08 12:44:30 +03:00
Alex Plate 87f5a6fab3 Remove stub classes
This solution was initially questionable. For a long time it produced nothing but more work on implementing the stubs.
2025-08-08 12:44:30 +03:00
Alex Plate 9d92ae9449 Remove the suspend from functions under the read or write actions
The suspending operations must not be performed under the read or write actions as this will lead to performance issues or freezes.

Also, the current implementation of launching coroutine under the write action is simply incorrect. The coroutine will escape the write action into another thread.
2025-08-08 12:44:30 +03:00
Alex Plate 492bd62166 Rename VimScope to VimApi and move it into a different package
`VimApi` would be a better entry point name. Also, the API term is clearer than the scope.
2025-08-08 12:44:30 +03:00
Alex Plate a0c213b90d Refactor Mode in API to be a simple enum
The current representation of Mode with `returnTo` is quite complicated and we're not even sure it'll remain like that.
At the same time, `mode()` function in Vim has quite a reach specification and there is a small chance it'll be changed. With this approach, we use values from Vim, yet in a form of enum.
2025-08-08 12:44:30 +03:00
Alex Plate fee75001f6 Do not allow to change the mode from the API
The details why we don't want this for now are logged in the code
2025-08-08 12:44:29 +03:00
Alex Plate df3fb1a8a3 Convert VimScope into the interface 2025-08-08 12:44:29 +03:00
Alex Plate 057f4eee5d The ReadImpl does not inherit the VimScopeImpl
`ReadImpl` didn't use anything from `VimScopeImpl`. This would make sense if `Read` inherited `VimScope`, but it doesn't.
Also, we'll always be able to bring back the dependency if we figure out it's necessary.
2025-08-08 12:44:29 +03:00
Alex Plate e2b20bb04d Reformat API module 2025-08-08 12:44:29 +03:00
Alex Plate add8023155 Rename @VimPluginDsl to @VimApiDsl
The API is a more correct term, despite the fact that the API will be mostly used from the plugins.
2025-08-08 12:44:29 +03:00
Alex Plate 88e77d1bea Add API module to the gradle config 2025-08-08 12:44:29 +03:00
Alex PlãteandGitHub 38fba69c33 Merge pull request #1246 from JetBrains/thin-api-first-draft
API for writing plugins
2025-08-01 15:43:46 +03:00
Alex Plate e13deb48cc Fix: Respect isIdeaVimDisabledHere flag in OctopusHandler 2025-07-25 13:13:29 +03:00
Alex Plate f12b0b04f6 Fix the contribution name of Jakub 2025-07-18 16:06:45 +03:00
Alex Plate ea4fc85e5b Add a new plugin for the verification 2025-07-18 16:04:00 +03:00
Alex Plate 4af8fc1868 Update TC configuration to run only needed tests 2025-07-18 16:04:00 +03:00
Alex Plate 1482ac0335 Fix(VIM-3970): Get rid of VimStandalonePluginUpdateChecker 2025-07-18 16:03:59 +03:00
Alex Plate 246425b1fb Mark IdeaVim as a plugin that supports vim configuration
In this way, we'll be able to actively promote IdeaVim as a suggested plugin in the IDE.

GO-17806
2025-06-27 19:43:08 +03:00