Allow syntax strings to contain test markers
We simply remove all the CUSTOM_MARKERS before attempting to parse the file. This allows for the syntax selection to work with most of the test strings.
This commit is contained in:
@@ -71,7 +71,9 @@ fn syntax_tree_for_token<T: AstToken>(node: &T, text_range: TextRange) -> Option
|
|||||||
.trim_start_matches('"')
|
.trim_start_matches('"')
|
||||||
.trim_end_matches('#')
|
.trim_end_matches('#')
|
||||||
.trim_end_matches('"')
|
.trim_end_matches('"')
|
||||||
.trim();
|
.trim()
|
||||||
|
// Remove custom markers
|
||||||
|
.replace("<|>", "");
|
||||||
|
|
||||||
let parsed = SourceFile::parse(&text);
|
let parsed = SourceFile::parse(&text);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user