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

refactor/renameSymbol method does not update buffer of opened module. #9960

Closed
farmaazon opened this issue May 15, 2024 · 7 comments
Closed
Assignees
Labels
--bug Type: bug -language-server p-high Should be completed in the next sprint
Milestone

Comments

@farmaazon
Copy link
Contributor

farmaazon commented May 15, 2024

In this branch there is IDE with "rename local method" feature. It calls refactor/rename method of language server and - when text/didChange message arrives - it reloads file using file/read method.

But file/read method returns the old state of the file, despite the documentation which says:

If the file is recorded as open by the language server, then the result will return the contents from the in-memory buffer rather than the file on disk.

To reproduce:

  • Switch to wip/farmaazon/rename-functions
  • Run project manager (I tested 5.15 nightly) and dev server npm --workspace enso-gui2 run dev
  • Open project with collapsed nodes and try to edit collapsed name in calling node. Note - if you cannot edit the name, then probably the local methods haven't been loaded to suggestion db due to some bug. Try restarting application (including PM).
  • Observe the logs of dev server

First we receive "did change" message with proper diff, but then, from file/read we receive old file.

@farmaazon farmaazon added p-high Should be completed in the next sprint --bug Type: bug -language-server labels May 15, 2024
@farmaazon farmaazon added this to the Beta Release milestone May 15, 2024
@farmaazon
Copy link
Contributor Author

I've assigned p-high because it prevents me from finishing #9790

@farmaazon farmaazon mentioned this issue May 16, 2024
4 tasks
@4e6
Copy link
Contributor

4e6 commented May 16, 2024

If the file is recorded as open by the language server, then the result will return the contents from the in-memory buffer rather than the file on disk.

Maybe it was supposed to be like that, but right now the file/read reads the contents from disk.

@4e6
Copy link
Contributor

4e6 commented May 16, 2024

There is another potential issue. The refactor/renameSymbol only returns changes related to the program and does not update the IdMap

@enso-bot
Copy link

enso-bot bot commented May 17, 2024

Dmitry Bushev reports a new STANDUP for today (2024-05-17):

Progress: Updated the file/read method to return the contents of a collaborative buffer if it was opened for the corresponding file. Added tests. Created a PR. It should be finished by 2024-05-22.

Next Day: Next day I will be working on the #9960 task. Continue working on the task

mergify bot pushed a commit that referenced this issue May 20, 2024
part of #9960

Changelog:
- feat: file/read return contents of a collaborative buffer if they are available and fallback to reading the file from disk
@4e6
Copy link
Contributor

4e6 commented May 21, 2024

The fix for the file/read #9994 is merged. The remaining issue is with the IdMap

@farmaazon
Copy link
Contributor Author

The fix for the file/read #9994 is merged. The remaining issue is with the IdMap

Regarding IdMap; our ydocs server (after a few tweaks) handles the idmap changes if received a code-only update. Thus, the task #9790 is no longer blocked.

For me, this task may be closed - we want to remove idmaps from files anyway.

@4e6
Copy link
Contributor

4e6 commented May 22, 2024

Ok, closing this one

@4e6 4e6 closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -language-server p-high Should be completed in the next sprint
Projects
Status: 🟢 Accepted
Development

No branches or pull requests

2 participants