Genio-The-Haiku-IDE / Genio

The Haiku IDE
Other
69 stars 9 forks source link

Rename symbol doesn't seem to work #405

Open humdingerb opened 4 months ago

humdingerb commented 4 months ago

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 commented 4 months ago

There's a regression under investigation.

jackburton79 commented 4 months ago

I reverted bab6caff8dffac8a9dc8879949ffbf34c401ac09 locally and it works again.

jackburton79 commented 4 months ago

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

humdingerb commented 4 months ago

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 commented 4 months ago

Is there a correlation between the opened files and the ones updated? I wonder if for some reason we are only able to edit files already open and we lost the capability of opening a file and apply the edits..

Il giorno mer 5 giu 2024 alle 15:07 humdinger @.***> ha scritto:

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.

— Reply to this email directly, view it on GitHub https://github.com/Genio-The-Haiku-IDE/Genio/issues/405#issuecomment-2149836921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALC2DU4QTJS2IQTKTWSWETZF4EQ3AVCNFSM6AAAAABIXYZMUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZHAZTMOJSGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

humdingerb commented 4 months ago

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 commented 4 months ago

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

humdingerb commented 4 months ago

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

Freaxed commented 3 months ago

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:

humdingerb commented 3 months ago

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?