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

Refactoring actions don't work when not using explicit project configuration #492

Open
hultberg opened this issue Oct 30, 2019 · 3 comments
Labels

Comments

@hultberg
Copy link
Contributor

I noticed that the intentions package is not working correctly anymore. The keybinding resolver successfully indicate that the intention package was triggered but the menu do not show. I have used the debugger and it stops at https://github.com/steelbrain/intentions/blob/v1.1.5/lib/commands.js#L127 which emits an event to see if the list should open. I'm not saying that this issue has been caused by serenata but the intentions package has not been updated for years and
I just wanted to bring attention to this issue.

The following is confirmed from my side:

  1. intentions:show is triggered but stops at the referenced line (see link)
  2. serenata provideIntentions is called and has 11 items on startup.

Can you provide any more hints and tips to debug this issue. The refactoring bit is an important functionality.

$ atom --version
Atom    : 1.41.0
Electron: 4.2.12
Chrome  : 69.0.3497.128
Node    : 10.11.0

$ apm --version
apm  2.4.3
npm  6.12.0
node 12.13.0 x64
atom 1.41.0
python 2.7.17
git 2.23.0
@Gert-dev
Copy link
Owner

Gert-dev commented Nov 2, 2019

Not to say that there is no problem, but for what it's worth intentions and refactoring functionality is still working here (also Atom 1.41.0). The fact that 11 items are returned sounds promising though.

Have you tried putting a breakpoint inside shouldListShow? Because it's async (promise-based), the debugger may be doing weird things when stepping.

Could it also be some sort of styling issue? You can try opening the developer tools, opening the intentions list, then clicking the developer tools with the mouse (if you touch the keyboard before it, the intentions list will close and disappear), and then search for something like Generate Getter And Setter Pair(s).

@hultberg
Copy link
Contributor Author

hultberg commented Nov 5, 2019

@Gert-dev I have pinned it down to this.getCurrentProjectPhpVersion() returning null which will not activate any intentions from serenata. Turns out my projects .serenata/config.json do not exists, but indexing and navigation still work as intended which is why I suspected the intentions part of serenata was at fault.

@Gert-dev
Copy link
Owner

Gert-dev commented Nov 23, 2019

That explains why I am not receiving it: I'm using explicit configurations everywhere. If you don't, and since 5.0, no configuration will be passed to Serenata and it will automatically try to configure itself for you to ease starting out, but then the client won't know what PHP version the server guessed.

In other words: this is a bug; if the client doesn't know the configuration, a solution is to just assume the lowest supported PHP version.

A better solution may be to request the determined version from the server, but since refactoring here is eventually going to be replaced by server-side refactoring actions (so other clients can profit from it, too), the former is the least amount of work until that happens.

Thanks for taking the time to track the bug down.

@Gert-dev Gert-dev changed the title Intentions not showing Refactoring actions don't work when not using explicit project configuration Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants