-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nested outline to refactored code (#611)
Co-authored-by: Lionel Henry <[email protected]>
- Loading branch information
Showing
3 changed files
with
326 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
221 changes: 221 additions & 0 deletions
221
...rc/lsp/snapshots/ark__lsp__symbols__tests__symbol_assignment_function_nested_section.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
--- | ||
source: crates/ark/src/lsp/symbols.rs | ||
expression: "test_symbol(\"\n## title0 ----\nfoo <- function() {\n # title1 ----\n ### title2 ----\n ## title3 ----\n # title4 ----\n}\n# title5 ----\")" | ||
--- | ||
[ | ||
DocumentSymbol { | ||
name: "title0", | ||
detail: None, | ||
kind: String, | ||
tags: None, | ||
deprecated: None, | ||
range: Range { | ||
start: Position { | ||
line: 1, | ||
character: 0, | ||
}, | ||
end: Position { | ||
line: 1, | ||
character: 14, | ||
}, | ||
}, | ||
selection_range: Range { | ||
start: Position { | ||
line: 1, | ||
character: 0, | ||
}, | ||
end: Position { | ||
line: 1, | ||
character: 14, | ||
}, | ||
}, | ||
children: Some( | ||
[ | ||
DocumentSymbol { | ||
name: "foo", | ||
detail: Some( | ||
"function()", | ||
), | ||
kind: Function, | ||
tags: None, | ||
deprecated: None, | ||
range: Range { | ||
start: Position { | ||
line: 2, | ||
character: 0, | ||
}, | ||
end: Position { | ||
line: 7, | ||
character: 1, | ||
}, | ||
}, | ||
selection_range: Range { | ||
start: Position { | ||
line: 2, | ||
character: 0, | ||
}, | ||
end: Position { | ||
line: 7, | ||
character: 1, | ||
}, | ||
}, | ||
children: Some( | ||
[ | ||
DocumentSymbol { | ||
name: "title1", | ||
detail: None, | ||
kind: String, | ||
tags: None, | ||
deprecated: None, | ||
range: Range { | ||
start: Position { | ||
line: 3, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 3, | ||
character: 15, | ||
}, | ||
}, | ||
selection_range: Range { | ||
start: Position { | ||
line: 3, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 3, | ||
character: 15, | ||
}, | ||
}, | ||
children: Some( | ||
[ | ||
DocumentSymbol { | ||
name: "title2", | ||
detail: None, | ||
kind: String, | ||
tags: None, | ||
deprecated: None, | ||
range: Range { | ||
start: Position { | ||
line: 4, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 4, | ||
character: 17, | ||
}, | ||
}, | ||
selection_range: Range { | ||
start: Position { | ||
line: 4, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 4, | ||
character: 17, | ||
}, | ||
}, | ||
children: Some( | ||
[], | ||
), | ||
}, | ||
DocumentSymbol { | ||
name: "title3", | ||
detail: None, | ||
kind: String, | ||
tags: None, | ||
deprecated: None, | ||
range: Range { | ||
start: Position { | ||
line: 5, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 5, | ||
character: 16, | ||
}, | ||
}, | ||
selection_range: Range { | ||
start: Position { | ||
line: 5, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 5, | ||
character: 16, | ||
}, | ||
}, | ||
children: Some( | ||
[], | ||
), | ||
}, | ||
], | ||
), | ||
}, | ||
DocumentSymbol { | ||
name: "title4", | ||
detail: None, | ||
kind: String, | ||
tags: None, | ||
deprecated: None, | ||
range: Range { | ||
start: Position { | ||
line: 6, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 6, | ||
character: 15, | ||
}, | ||
}, | ||
selection_range: Range { | ||
start: Position { | ||
line: 6, | ||
character: 2, | ||
}, | ||
end: Position { | ||
line: 6, | ||
character: 15, | ||
}, | ||
}, | ||
children: Some( | ||
[], | ||
), | ||
}, | ||
], | ||
), | ||
}, | ||
], | ||
), | ||
}, | ||
DocumentSymbol { | ||
name: "title5", | ||
detail: None, | ||
kind: String, | ||
tags: None, | ||
deprecated: None, | ||
range: Range { | ||
start: Position { | ||
line: 8, | ||
character: 0, | ||
}, | ||
end: Position { | ||
line: 8, | ||
character: 13, | ||
}, | ||
}, | ||
selection_range: Range { | ||
start: Position { | ||
line: 8, | ||
character: 0, | ||
}, | ||
end: Position { | ||
line: 8, | ||
character: 13, | ||
}, | ||
}, | ||
children: Some( | ||
[], | ||
), | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters