patleeman / VSNotes

Simple VS Code extension for plain text note taking.
https://marketplace.visualstudio.com/items?itemName=patricklee.vsnotes
MIT License
174 stars 33 forks source link

Improve front matter parsing #80

Open jozefs opened 4 years ago

jozefs commented 4 years ago

This series of commits:

  1. 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.

  2. Fixes linting errors in existing code found by the new npm lint task added in the commit above.

  3. 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 #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.)