-
Notifications
You must be signed in to change notification settings - Fork 38
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
scip test
command
#235
Comments
Not opposed to adding something here if it helps simplify something downstream, but I'm afraid I don't quite understand the distinction you're making with "making it clearer from a test file perspective what is intentional". AFAICT, the Could you elaborate on the expected difference between running |
👋 Hey @varungandhi-src
I think I was specifically referring to the highlight query tests as opposed to the corpus tests
For a more concrete example, say I want to specifically test how scip-dart handles function indexing, if I were to test this using the existing void foo(String bar) {
// definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/
// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/foo().
// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String#
// ^^^ definition local 0
print('test');
// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print().
} This is a lot of data, and obscures the specifics of what I'd like to test. If instead I could specifically write the "symbols" which I'd like to test, this could be written as follows: void foo(String bar) {
// ^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/foo().
print('test');
// <- reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print().
} This is much clearer that I'm specifically trying to validate functions and their invocations, and is an explicit "pass/fail" determined by an explicit dev making a written assumption |
Understood. I think this would be OK to add as a separate sub-command, I can see the usefulness. We don't have bandwidth to tackle this ourselves right now, but I can review a PR if someone is willing to implement it. |
Yep! No worries, that was my assumption Just wanted to verify it would be an acceptable PR before doing the implementation work |
While developing tree-sitter grammars, I've gotten pretty used to the
tree-sitter test
command, where selections are explicitly stated within test files, and the result passes and fails based on whether the parser matches whats specifiedWhat would the thought be around creating a
scip test
command which mirrors how tree-sitter highlight tests work?For example, the following file would be committed a
test/
directory, andscip test ./index.scip
would pass or fail depending on if theFoo
symbol had the correct definitionIdeally all "selectors" could be used this way as well,
reference
,documentation
,diagnostic
, andrelationship
...This would be offered as an alternate to the existing
scip snapshot
, where individual language features are tested, making it clearer from a test file perspective what is intentionalThe text was updated successfully, but these errors were encountered: