-
Notifications
You must be signed in to change notification settings - Fork 50
Conversation
77dcd68
to
341909a
Compare
5ca6c02
to
37da827
Compare
We have many patterns for embedded languages in HEREDOCs, and manually ensuring they are correct can be problematic. This introduces tests to enforce their correctness, generated from an easier to manage minimal config.
37da827
to
513dbc9
Compare
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.
Very nice! Just a question about the TS config.
@@ -3,7 +3,7 @@ | |||
"module": "commonjs", | |||
"target": "ES2020", | |||
"outDir": "out", | |||
"lib": ["ES2020"], | |||
"lib": ["dom", "ESNext"], |
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.
Why do we need this change?
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.
ESNext
is needed forArray#toSorted
dom
is needed forWebAssembly
&Response
types, which are used bynode_modules/vscode-oniguruma/main.d.ts
1
AFAIK the code still ends up the same though, as target
hasn't changed.
Footnotes
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 made a few tests and it seems like everything is fine after changing the targets. Let's move forward with this and I can make a preview extension release just to confirm the compilation works - before doing the stable release.
Motivation
We have many patterns for embedded languages in HEREDOCs, and manually ensuring they are correct can be problematic, especially as we want to add new ones (e.g.
YAML
).Implementation
This introduces tests to enforce their correctness, generated from an easier to manage minimal config. It also adds tests to actually check that the grammar results in parsing the expected tokens.
Automated Tests
The first commit consists of only tests. 📈
The second commit is a TDD change to capitalization.
Manual Tests
If heredoc highlighting continues to work, everything is working.