feat(api): Get symbol and breadcrumb at location
Currently the implementation is very limited. Ref: #24 - Outline must be open and have been loaded for it to work (requires lazy loading or headless loading of Sidebar) - Empty string returned if cursor is not in any symbol ('closest' symbol not yet supported) - Line column not used - Returning concatenated symbol names rather than a list of tables with node info (requires a refactor of outline.SymbolNode type) - Subject to config.symbols.filter and folds (requires finding hover list somewhere outside of writer.make_outline)
This commit is contained in:
19
README.md
19
README.md
@@ -790,6 +790,25 @@ require'outline'
|
||||
This is automatically called on events
|
||||
`outline_items.auto_update_events.refresh` from config.
|
||||
|
||||
- **get_breadcrumb(opts)**
|
||||
|
||||
Return a string concatenated from hovered symbols hierarchy representing code
|
||||
location.
|
||||
|
||||
Optional opts table fields:
|
||||
- depth (nil): Maximum depth of the last symbol included. First item has depth 1.
|
||||
Set to 0 or nil to include all
|
||||
- sep (` > `): String for separator
|
||||
|
||||
- **get_symbol(opts)**
|
||||
|
||||
Return the symbol name of the deepest hovered symbol representing code
|
||||
location.
|
||||
|
||||
Optional opts table fields:
|
||||
- depth (nil): Maximum depth of the returned symbol
|
||||
- kind (nil): Symbol kind to search for (string).
|
||||
|
||||
|
||||
## Tips
|
||||
|
||||
|
||||
Reference in New Issue
Block a user