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

Rename symbol doesn't seem to work #405

Open
humdingerb opened this issue Jun 4, 2024 · 10 comments
Open

Rename symbol doesn't seem to work #405

humdingerb opened this issue Jun 4, 2024 · 10 comments
Milestone

Comments

@humdingerb
Copy link
Contributor

Is renaming symbols supposed to work currently?

I open "DateBox.cpp" of the CapitalBe project, select DateBox::DateBox from the Outline pane. From the context menu I "Rename symbol" to DateCalendarBox.

Nothing gets renamed, neither in DateBox.cpp nor in any other file that references "DateBox".

Attached is the output with log level trace: symbol-rename-trace.txt

@nexus6-haiku
Copy link
Collaborator

There's a regression under investigation.

@jackburton79
Copy link
Collaborator

I reverted bab6caf locally and it works again.

@jackburton79
Copy link
Collaborator

Should be fixed by f0c1dbe (although it seems you have to wait a bit after opening a file, before using Rename)

@humdingerb
Copy link
Contributor Author

I can confirm that it works, but only within the .cpp and its .h file. Or like this:

In the above CapitalBe example:
Open "CheckView.cpp" and "Rename symbol" (from the editor view's context menu) on "DateBox) in the line:

fDate = new DateBox("dateentry", "", NULL, new BMessage(M_DATE_CHANGED));

Rename "DateBox" to "TheDateBox".

It gets correctly renamed in "CheckView.cpp" and "DateBox.cpp" and "DateBox.h, but not in all the other files in the project.

@Freaxed
Copy link
Collaborator

Freaxed commented Jun 5, 2024 via email

@humdingerb
Copy link
Contributor Author

Yes, it appears so.
Only files that have been opened already once, are re-opened to rename the symbol. For example, that "DateBox" is used in 6 different files. If I open the first two and their .h files (and close them again), they get reopened and "DateBox" gets renamed. The other 4 .cpp and .h files where "DateBox" is found by the "Find in project" search remain untouched.

@jackburton79
Copy link
Collaborator

Is there a compile db available or not ? (just to be able to understand how it behaves in various cases)

@humdingerb
Copy link
Contributor Author

Nope, no db in the project's folder nor in /boot/home/config/settings/Genio

@jackburton79 jackburton79 added this to the v3.0 milestone Jun 7, 2024
@Freaxed
Copy link
Collaborator

Freaxed commented Jun 8, 2024

I think the behaviour is correct. If you don't have a compile_commands.json file, LSP doens't know what files are included in the project unless you open them (at this point is Genio telling LSP the file is included).
There are a couple of things we could do to improve the user experience:

  • Introduce a way to check if the compile_commands is there and if it's synchronized with the Makefile/Jam/etc..
  • Introduce some sort of indicator to understand what is LSP doing and if it's ready to perform an action (enable the menus only when fully ready)

@humdingerb
Copy link
Contributor Author

There are a couple of things we could do to improve the user experience:

Yeah, especially for the small time hobby/beginner coder. We don't think about what is needed in the background (LSP <->IDE) for some feature to work.
Can't Genio scan all files in the (sub)folders of the project when opening is and do what happens when a user opens a file without actually opening it? Or is that to time-consuming? Can it be cached?

@nexus6-haiku nexus6-haiku modified the milestones: v3.0, v4.0 Jun 14, 2024
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

No branches or pull requests

4 participants