diff options
author | Ville Penttinen <[email protected]> | 2019-03-04 07:19:46 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-03-04 07:19:46 +0000 |
commit | 1ef2c0613134633ef0fe0d515f7d416e482f07fb (patch) | |
tree | c782b2b62dcfaa253b8ed55824772ea7bf8fa16d /crates/ra_ide_api/src | |
parent | 16ecd276f036de9b5dccdbcce55b25a2a5699385 (diff) |
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.
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/syntax_tree.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/syntax_tree.rs b/crates/ra_ide_api/src/syntax_tree.rs index cdee63d59..bbe9222b4 100644 --- a/crates/ra_ide_api/src/syntax_tree.rs +++ b/crates/ra_ide_api/src/syntax_tree.rs | |||
@@ -71,7 +71,9 @@ fn syntax_tree_for_token<T: AstToken>(node: &T, text_range: TextRange) -> Option | |||
71 | .trim_start_matches('"') | 71 | .trim_start_matches('"') |
72 | .trim_end_matches('#') | 72 | .trim_end_matches('#') |
73 | .trim_end_matches('"') | 73 | .trim_end_matches('"') |
74 | .trim(); | 74 | .trim() |
75 | // Remove custom markers | ||
76 | .replace("<|>", ""); | ||
75 | 77 | ||
76 | let parsed = SourceFile::parse(&text); | 78 | let parsed = SourceFile::parse(&text); |
77 | 79 | ||