mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
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:
parent
16ecd276f0
commit
1ef2c06131
1 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,9 @@ fn syntax_tree_for_token<T: AstToken>(node: &T, text_range: TextRange) -> Option
|
|||
.trim_start_matches('"')
|
||||
.trim_end_matches('#')
|
||||
.trim_end_matches('"')
|
||||
.trim();
|
||||
.trim()
|
||||
// Remove custom markers
|
||||
.replace("<|>", "");
|
||||
|
||||
let parsed = SourceFile::parse(&text);
|
||||
|
||||
|
|
Loading…
Reference in a new issue