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:
Ville Penttinen 2019-03-04 09:19:46 +02:00
parent 16ecd276f0
commit 1ef2c06131

View file

@ -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);