Trim redundant prefixes of syntax test suggestions.#340
Trim redundant prefixes of syntax test suggestions.#340FichteFoll merged 3 commits intoSublimeText:masterfrom
Conversation
|
Asume your test cases are located within a As It only works if The stripping algorithm should therefore lookup e.g. |
|
It should handle that now. Some examples: // SYNTAX TEST "Packages/JavaScript/JavaScript.sublime-syntax"
{
if ( true ) { }
// ^^^^^^^^^^^^^^^ meta
// ^ meta.block meta.conditional meta.group punctuation.section.group.begin
}
{
if ( true ) { }
// ^^^^^^^^^^^^^^^ meta.block
// ^ meta.conditional meta.group punctuation.section.group.begin
}
{
if ( true ) { }
// ^^^^^^^^^^^^^^^ meta.block meta
// ^ meta.conditional meta.group punctuation.section.group.begin
}
{
if ( true ) { }
// ^^^^^^^^^^^^^^^ meta.conditional
// ^ meta.group punctuation.section.group.begin
}Hopefully the implementation's not too abstruse. |
|
The algorithm seems to fail in case of more complicated test selectors such as |
|
Can you post the line of code being tested? Also, is that Verilog? |
|
It's SCL (Structured Control Language) a subset of ST (Structured Text) used to program PLCs. I am about to create syntax support for it. The code snippet being tested is: Already got an idea of what's going wrong. Maybe nothing we can fix anyway. Due to an syntax issue the pattern |
|
Thanks for these changes. They seem to work pretty well for the 99% case and we can do follow-ups for edge cases later, if we need to. I also enabled this feature by default. Also, sorry about the delay, but I wanted to make sure this works properly before packing up a release. |
The implementation isn't necessarily final, but feedback would be appreciated.
First, a motivating example. The pipe denotes the cursor, and
syntax_test.suggest_scope_suffixis false.Before:
Ordinary result of typing
^:With
"syntax_test.suggest_trimmed_prefix": true:The implementation is a first pass, but it's probably mostly correct. Notes:
assertion_scopesproperty toAssertionLineDetailsrather than re-extracting that in the new code.