Skip to content

Conversation

@luis-j-soares
Copy link
Collaborator

@luis-j-soares luis-j-soares commented Mar 5, 2025

This PR attempts to fix a watch mode issue where field initialisers will trigger diagnostic errors after their scope is transpiled.

Notes:

  • This is still a draft because fixing this with .clone() breaks enums. Still figuring out how to fix that.
  • Reverted the .clone() solution because it conflicts with how the transpile method of enum/const value expressions are overwritten by editor. It might be better to clone the entire AST before transpiling the file, but that might incur its own issues...
    • Cloning the AST of a file could significantly increase memory usage;
    • The AST would need to be walked all over again to set parent references, which delays transpiling times;
    • Any plugin logic that stores AST node references on parse/validate will break, as transpile methods would effectively be working with a different AST.

@luis-j-soares luis-j-soares changed the title Fix watch mode errors on subsequent saves Fix watch mode errors on scope changes after transpilation Mar 5, 2025
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

Successfully merging this pull request may close these issues.

1 participant