Skip to content
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

Reimplement IdeaVim integration #354

Closed
breandan opened this issue Apr 3, 2021 · 4 comments
Closed

Reimplement IdeaVim integration #354

breandan opened this issue Apr 3, 2021 · 4 comments
Assignees

Comments

@breandan
Copy link
Collaborator

breandan commented Apr 3, 2021

Need to reimplement #307 post-refactoring.

@breandan
Copy link
Collaborator Author

breandan commented Apr 3, 2021

All right, after merging #353 and reimplementing listeners, I think we have arrived at a solution that restores the functionality which IdeaVim-EasyMotion expects. Although b33ae48 uses SearchProcessor in a way I'm not sure @chylex intended, it seems to be working.

The way these changes affect @AlexPl292 should be minimal. The major difference is that AceJump is now Session-based.

Callers who pass an instance of Editor into SessionManager.start(editor) will receive a Session instance in return. Looking at how IdeaVim-EasyMotion is using us, this should not be an issue, since an Editor is usually in scope. Sessions are disposed after use.

To use AceJump externally, please use the following example:

import org.acejump.session.SessionManager
import org.acejump.session.AceJumpListener
import org.acejump.search.Pattern
import org.acejump.boundaries.*

val aceJumpSession = SessionManager.start(editorInstance)

aceJumpSession.addAceJumpListener(object: AceJumpListener {
  override fun finished() {
    // ...
  }
})

// Sessions provide these endpoints for external consumers:

/*1.*/ aceJumpSession.markResults(sortedSetOf(/*...*/)) // Pass a set of offsets
/*2.*/ aceJumpSession.startRegexSearch("[aeiou]+", WHOLE_FILE) // Search for regex
/*3.*/ aceJumpSession.startRegexSearch(Pattern.ALL_WORDS, VISIBLE_ON_SCREEN) // Search for Pattern

Unless there are any objections, I am planning to release these changes with 3.7.0.

@AlexPl292 @chylex Please let me know if you have any questions or concerns.

@chylex
Copy link
Collaborator

chylex commented Apr 3, 2021

I think the use of SearchProcessor is fine, can't think of any issues. Also worth mentioning that custom boundaries for search (i.e. current line before caret etc.) can now be defined in easymotion using the Boundaries interface.

@AlexPl292
Copy link
Contributor

Yay, glad to see such a big update of AceJump!
The sad note is that IdeaVim-EasyMotion integration was a bit ruined by these changes (no surprise, as I see almost everything was updated), so at the moment I've preformed a hot release just to make it compatible with the 3.7 version. A bit later, I'll dive into it to restore all the functionality.

@chylex great work! 🎉

@breandan
Copy link
Collaborator Author

breandan commented Apr 5, 2021

I apologize for the disruption, you can blame me for ruining IdeaVim-EasyMotion and thank @chylex for fixing almost all our outstanding bugs. In the future, I will try to coordinate and communicate breaking changes in a more timely manner.

@breandan breandan closed this as completed Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants