-
Notifications
You must be signed in to change notification settings - Fork 328
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
Discrepancy in parser metadata handling between LS and GUI #6718
Comments
|
After speaking with @mwu-tow about this, I think the GUI is doing the right thing here. It is important not to assign IDs to two nodes that have the same span; a (very simple) module could have the same span as its child line. Since the IDE and the LS must be consistent, we should change this on the LS side. |
This PR adds facilities for controllers to be aware of what shortcut command is currently being processed. This allows grouping consequences of single user action into a single transaction without hard-coding it separately for all the separate paths case-by-case, which turned out to be challenging and error-prone. Additionally, a number of minor fixes were carried over from #6877: * workaround for #6718; * avoiding creating spurious transactions when dealing with node positions; * dropping any non-user user-triggered transactions that occur during the IDE project initialization.
The Language Server only reads and never updates the metadata. If it tries to do that, it will result in a checksum error after the following |
Unrelated & colloquial: According to @kustosz, the motivation for using UUIDs was exactly to allow every party (including language server) to introduce new UUID. If that feature isn't used by language server, I could propose to stop using UUIDs again ;-) |
I agree that using the path in the tree instead of UUID is a more elegant solution, but it will require work on both ide and the engine side in order to support it |
Probably not needed if we implement #9257 and co.: |
Removing as obsolete. |
As I was looking into Undo/Redo issues, I observed that some operations are triggering code text edits even when there is no reason to.
One of the reasons seems to be a discrepancy between GUI and Engine in how they handle metadata.
Consider the following code from the initial project:
Note the last entry in the ID map is
[{"index":{"value":0},"size":{"value":215}},"82008f59-2c5c-45fd-a2f0-e85268502888"]
. It assigns an ID to the whole module's scope, likely corresponding to the root ASTModule
node.However, when GUI parser it, the root
Module
node does not have an ID assigned to it. After looking into translation code it seems that it was intentional, as thenew_no_id
constructor is used. Thus, when GUI converts the AST back to text, the ID disappears, introducing a faux difference.The problem is that the Language Server seems to be introducing this ID back on its own, causing some kind of edit war between the GUI and the Language Server and causing trouble for Undo/Redo functionality.
I suppose that this is caused by LS using a different parser API, not relying on Rust's AST translation code.
We should either:
The text was updated successfully, but these errors were encountered: