-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax highlighting - needs automated tests #696
Comments
We're planning to ship 1.4 soon. Once that happens, I'll start working on this. PR #725 integrates mocha for testing. |
I literally started looking into this 10 minutes ago and was just in the process of setting up typings and mocha. I was looking at vscode-textmate and if that can be used to check the token output. :) |
@DustinCampbell I have built something that works well for me, is quite minimal on top of the I would create a pull request now, but there will be some plumbing duplication with #725 (mocha, chai and typings set-up). I will wait for once #725 lands in and then create one on top. import { assert } from 'chai'
import { Tokenizer, Token, Tokens } from './tokenizer'
let input = `
namespace TestNamespace
{
}`;
let tokens: Token[] = new Tokenizer().tokenize(input);
assert.include(Tokens.NamespaceKeyword("namespace"), tokens);
assert.include(Tokens.NamespaceIdentifier("TestNamespace"), tokens); |
Cool! Looking forward to it! |
@DustinCampbell I have created a temporary repo which captures my current approach here: https://github.com/ivanz/omnisharp-csharp-grammar-test-harness in order to get early feedback. Let me know what your thougths are! Example tests for "namespace"are here and the interesting implemntation bits are here. You can build and run with The idea is to wrap |
I've migrated the above code into a pull request in #742 |
The syntax highlighting is based on a regex-based grammar and because there aren't any automated tests to validate changes - it is easy to cause regressions without knowing.
The text was updated successfully, but these errors were encountered: