Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Add new Xtend editor quickfixes on *.xtend files #1060

Closed
miklossy opened this issue May 28, 2020 · 23 comments
Closed

Add new Xtend editor quickfixes on *.xtend files #1060

miklossy opened this issue May 28, 2020 · 23 comments

Comments

@miklossy
Copy link
Contributor

The Xtend IDE should provide the following quickfixes on *.xtend files:

@loradd Would you like to take care of this issue?

@loradd
Copy link
Contributor

loradd commented Jun 1, 2020

Yes, I can take care of this. Thanks!

@loradd
Copy link
Contributor

loradd commented Jun 2, 2020

@miklossy it is not clear what is meant with constant in #454088, do we mean a final static instance member?

@miklossy
Copy link
Contributor Author

miklossy commented Jun 2, 2020

Yes

@miklossy
Copy link
Contributor Author

miklossy commented Jun 8, 2020

Currently, whenever the Xtend IDE recognizes that a method is missing, it offers a quickfix for creating the method:
screenshot
It should be useful to offer an additional quickfix for creating a private method, in the example above there should be three quickfixes:

  • Change to 'a'
  • Create public method 'm'
  • Create private method 'm'

@loradd Maybe you can fix this first.

@szarnekow
Copy link
Contributor

@miklossy This should be discussed. I don't want to have quickfixes for all permutations of modifiers.

@miklossy
Copy link
Contributor Author

miklossy commented Jun 8, 2020

@szarnekow I do not want to have quickfixes for all permutations of modifiers either. But creating a private method would be very useful, at least I would use that one more often than creating a public method. Currently I use the quickfix that creates a public method and have to modify that one to convert the created public method to private.

Let's see what others think about this.

@kthoms
Copy link

kthoms commented Jun 8, 2020

Creating a private method sounds as a likely choice. If this would be added I would not change the text for creating a public method, though.

@miklossy
Copy link
Contributor Author

miklossy commented Jun 8, 2020

Hint: JDT offers a quickfix for creating a private method, but no quickfix to create a public one.
screenshot2

@szarnekow
Copy link
Contributor

JDT uses placeholders in the proposed method.

@miklossy
Copy link
Contributor Author

miklossy commented Jun 8, 2020

@szarnekow It is true:
screenshot3
Placeholders are nice to have, but I would be also fine with two different quickfixes.

@szarnekow
Copy link
Contributor

Please note that there already two quickfixes Create method and Create extension method (the latter only, if there is an explicit receiver).
That would make it four quickfixes Create method, Create private method, Create extension method and Create private extension method.
I would object this kind of change for usability reasons. If you use the quickfix to create a method, you have to navigate to that method to create the body anyways.

@miklossy
Copy link
Contributor Author

miklossy commented Jun 8, 2020

@szarnekow What about changing the already existing two quickfixes to create private methods instead of public ones?

@szarnekow
Copy link
Contributor

@miklossy In Xtend, methods are public by default. Why should the quickfix create a non-default method? What would be a reasonable explanation for that behavior?

@miklossy
Copy link
Contributor Author

miklossy commented Jun 8, 2020

I use Xtend mostly to define JUnit test cases. When following the TDD manner, it is a common way to create test helper methods in the test classes using that quickfix. Since the test helper methods are usually private, it would be useful to be able to create private method stubs using a quickfix.

Maybe we can unify the create method and the create extension method quickfixes into a single create method quickfix, since they create the same method stubs.

@cdietrich : What do you think?

@loradd
Copy link
Contributor

loradd commented Jun 9, 2020

@miklossy I am not able to reproduce issue #412593. The quickfix proposal concerns static members, not instance members, as expected. Could it be that the issue has already been solved?

@miklossy
Copy link
Contributor Author

@loradd I can still reproduce the problem:
screencast

@szarnekow
Copy link
Contributor

I reconsidered this. It would be ok for me if we offered Create private method and Create private extension along with the currently available quickfixes.

@miklossy
Copy link
Contributor Author

@loradd How is the progress here?

@loradd
Copy link
Contributor

loradd commented Jul 19, 2020

@miklossy waiting for a second review on pull request #1068

@miklossy
Copy link
Contributor Author

@cdietrich @szarnekow @ArneDeutsch @kthoms Could please someone review the PR?

@cdietrich
Copy link
Member

@miklossy what is the state?

cdietrich added a commit that referenced this issue Aug 21, 2020
Add new Xtend editor quickfixes on *.xtend files #1060
@miklossy
Copy link
Contributor Author

I do not know the current state. Someone should take a look at it as requested a month ago.

@cdietrich @szarnekow @ArneDeutsch @kthoms Could please someone review the PR?

@cdietrich
Copy link
Member

Fixed in 2.23

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants