This repository was archived by the owner on Mar 27, 2023. It is now read-only.
Improve front matter parsing #80
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This series of commits:
Migrates the testing infrastructure to
vscode-test. The changes follow practices set by Microsoft's current sample code.The tests are set up to be written in TypeScript, however the production code is left as JavaScript.
Fixes linting errors in existing code found by the new
npm linttask added in the commit above.And finally, the duplicated front matter parsing code is extracted into its own class. Its behaviour is covered by unit tests. The new parsing code fixes front-matter parsing causes error and high cpu utilization #77.
Assuming that this approach is acceptable, I'll continue refactoring the code to make it more testable and writing tests. These changes will make it easier and safer to add new features in the future.
Ideally I'd like to start using TypeScript in the production code as well to get the benefit of static typing.
I would also like to set up a pipeline to run the tests automatically, including on pull requests. (edit There is now a working pipeline tied to my fork.)