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

Fleet #897

Merged
merged 22 commits into from
Jun 5, 2024
Merged

Fleet #897

merged 22 commits into from
Jun 5, 2024

Conversation

lippfi
Copy link
Contributor

@lippfi lippfi commented Jun 2, 2024

One more set of changes for Fleet

@@ -95,6 +95,18 @@ public class ExEntryPanelService : VimCommandLineService {
return panel
}

public override fun createWithoutShortcuts(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createSomething usually used when we actually create a new instance of the object.
Here we reuse initialized instance of the ExEntryPanel, so I'd say that this method should be named also getInstance....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In IdeaVim, we reuse the initialized instance, but this is unlikely to be the case for Fleet. The implementation details of IdeaVim should not influence naming of the new API
Previously, we used getInstanceWithoutShortcuts() and then called activate() on it. Now, however, we have adopted a more intuitive approach by directly calling createWithoutShortcuts()

@@ -11,6 +11,8 @@ package com.maddyhome.idea.vim.api
import javax.swing.KeyStroke

public interface VimCommandLine {
public val caret: VimCommandLineCaret
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this change is included in this commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any objective reason for this; I just felt that this field would look better at the top of the class and didn't want to create a separate commit for such a minor change

@@ -209,11 +207,11 @@ private void setFontToJField(String stringToDisplay) {

void setEditor(@NotNull Editor editor, DataContext context) {
this.context = context;
EditorHolderService.getInstance().setEditor(editor);
ExEntryPanel.getInstance().setEditor(editor);
}

public Editor getEditor() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires @Nullable on return type now


/**
* The type of the last used pattern.
*/
private var lastPatternType: PatternType? = null
@JvmStatic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need all new @JvmStatic? I see that their usage was moved from java class to kotlin class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Kotlin magic to make protected fields in companion objects work

@AlexPl292 AlexPl292 merged commit 2c0ff58 into master Jun 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants