-
Notifications
You must be signed in to change notification settings - Fork 318
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
Syntactic synchronization, automatic parentheses, metadata in Ast #8893
Conversation
(Stacked on #8891). |
app/gui2/shared/ast/tree.ts
Outdated
export type NodeMetadataFields = { | ||
position?: { x: number; y: number } | undefined | ||
visualization?: VisualizationMetadata | undefined | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't NodeMetadataFields
also inherit MetadataFields
? Nodes have externalId too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. Although all nodes are Ast
s, I wouldn't consider the externalId
part of the node metadata. Their updates are currently handled separately, and in practice IDs have to be handled a bit specially--if an Ast has only one concrete child, that child should inherit the parent's externalId
(this will be more important once we have AssignmentExpression
nodes as a stable place to attach node metadata).
I'm not opposed to making MetadataFields
the root of a metadata hierarchy if we find it would simplify anything, but currently (with the little metadata we have so far) I'm not seeing that to be the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving the ide-desktop
changes, which changes the bundled format for the Electron entrypoint code from CJS to ESM. i haven't tested though, so make sure Electron still works fine for both ide
and ide2
.
is there a reason why we need the client to be ESM, btw? |
@somebody1234 |
Update (@farmaazon): The only blocker left is packaging. Here's what I've found:
To get top level await working by switching to ESM bundling:
Alternatively instead of top-level await we could explicitly await the parser loading, but we'd have to do so in various places--when starting the ydocserver, the app/mock, and tests that need the parser. |
The problem with switching to ESM is our Trivial to replace:
Harder to replace:
|
#8893 introduced a fatal regression for old IDE + new IDE also does not work on every system. The fix: 1. Don't assume that WASM needed by ydocs server is bundled 2. Don't assume we know its exact name.
Pull Request Description
externalId
and all node metadata into a Y.Map owned by eachAst
. This allows including metadata changes in an edit, enables Y.Js merging of changes to different metadata fields, and will enable the use of Y.Js objects in metadata. (Implements Keeping metadata as part of AST. #8804.)Important Notes
Ast
objects.commitDirect
,skipTreeRepair
) are provided for careful use in certain cases.src/generated
that may occur when switching branches.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.