Add technical information to AST #353
Replies: 2 comments
-
Not to confuse with #357, see #351 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Outdated because no AST exists anymore |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Informations like file name, line number, start and end character position are needed in certain situations. The current AST has no such information attached.
This means that each plugin that parses files into an AST needs to provide that information. So parsing json as a simple JS object is no longer possible. A more sophisticated parser is needed.
This could speed up writing changes to disk because just a small part of a file needs to be altered instead of rewriting the full file. This would also keep the formatting of a file intact. If someone prefers 3 spaces instead of the 2 spaces used in the plugin, then it would keep the format and just replace a single JSON property.
Use-cases:
@inlang/core/lint
#351 (comment)Beta Was this translation helpful? Give feedback.
All reactions