Commit Graph

612 Commits

Author SHA1 Message Date
hedy
b6b2bf2248 fix: segfault? 2023-11-26 22:36:20 +08:00
hedy
8c13999acc feat: Update outline on rename symbol
Also added ability to show provider status from code_action and
rename_symbol
2023-11-26 20:44:42 +08:00
hedy
c1064c69fe Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-26 16:49:42 +08:00
hedy
5b70292780 Refactor symbol types 2023-11-26 16:49:25 +08:00
hedyhli
55921a669c Auto generate vim docs 2023-11-26 07:30:20 +00:00
hedy
5764294eb7 docs: List asciidoc external provider 2023-11-26 15:29:37 +08:00
hedy
c4da6670a4 refactor: Consistent naming of buf/win fields 2023-11-26 15:27:57 +08:00
hedy
c7d38eea24 refactor: Reorganize keymap order 2023-11-26 15:24:21 +08:00
hedy
39668e5061 feat: Go to corresponding code window after closing outline 2023-11-26 15:23:53 +08:00
hedy
8062cff1a4 Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-26 15:16:50 +08:00
hedy
b90174c6c2 refactor: Provider symbol actions
It makes sense to store the provider each sidebar is using with own
self.provider fields, no way that did not occur to me before this.

The old `_G._outline_current_provider` ironically, can now be replaced
by `require('outline').current.provider`.
2023-11-26 15:14:42 +08:00
hedyhli
f4f864c959 Auto generate vim docs 2023-11-26 05:30:15 +00:00
hedy
1743ee7c66 chore(fmt): stylua 2023-11-26 13:29:47 +08:00
hedy
137e76fdca chore(fmt): Consistent function doc style 2023-11-26 13:27:29 +08:00
hedy
9f69f12161 refactor: Reorganize modules
Primarily:
- Utils
- Sidebar (removed the need of writer.lua)
- Resolve keymaps shortcut in config eraly
- Put highlight functions into highlight.lua
- Put functions that do stuff on outline window into view.lua
2023-11-26 13:17:18 +08:00
hedy
b83e84a15f Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-25 16:24:24 +08:00
hedy
bdeff23390 refactor(writer): Move make_outline to sidebar
Was passing self fields a lot, decided to just do all that in Sidebar
in the first place.

Also resolved guides.enabled=false early to setting markers to ' '.

Everything should work the same.
2023-11-25 16:21:44 +08:00
hedy
6d85399550 feat: Use more concise API names
No breaking change.
2023-11-25 15:43:36 +08:00
hedy
6cea72f2b5 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)
2023-11-25 15:41:55 +08:00
hedy
35abd07a6f Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-25 11:25:32 +08:00
hedy
c7a033e85d chore: Remove debug message 2023-11-25 11:25:26 +08:00
hedyhli
f9cca2c160 Auto generate vim docs 2023-11-25 03:21:18 +00:00
hedy
9d476dcfbd Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-25 11:20:51 +08:00
hedy
44fdeac29a fix(writer): Ensure all buffer namespaces are cleared
...before setting highlights

Closes #38
2023-11-25 11:18:16 +08:00
hedyhli
a6dd1d11a7 Auto generate vim docs 2023-11-24 09:26:49 +00:00
hedy
f586147ee2 docs: Fix readme -> vimdoc ignore sections 2023-11-24 17:26:09 +08:00
hedyhli
dc0d37e799 Auto generate vim docs 2023-11-24 09:18:13 +00:00
hedy
9fcb576c8e Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-24 17:17:51 +08:00
hedy
e5ee7dd15a docs: Fix capitalization 2023-11-24 17:17:45 +08:00
hedyhli
8f1c430eb2 Auto generate vim docs 2023-11-24 09:17:12 +00:00
hedy
842f2c4a86 refactor(status,help): Rename module and make naming more descriptive 2023-11-24 17:16:44 +08:00
hedy
ecc814f846 fix(api): Add back is_focus_in_outline 2023-11-24 17:13:59 +08:00
hedy
a7fe7baf5f fix(markdown): Revert a change from a previous commit 2023-11-24 17:13:44 +08:00
hedy
1c856660a4 docs: Update readme and changelog 2023-11-24 17:13:25 +08:00
hedy
fab3e8ce7c feat(status): Use custom highlight with default links 2023-11-24 16:47:36 +08:00
hedy
896fd2ae63 feat(status): Better information and highlights 2023-11-24 16:31:16 +08:00
hedy
f4d5eb2dad fix(status): Show code window active when no outline opened yet 2023-11-24 16:17:52 +08:00
hedy
b475574fc0 fix(jsx): Label JSX fragment with Fragment kind 2023-11-24 16:11:25 +08:00
hedy
a2410faba9 refactor: Rename module ui -> highlight 2023-11-24 16:10:21 +08:00
hedy
23958f8731 chore(fmt): stylua 2023-11-24 15:04:28 +08:00
hedy
ebf90dc9ee fix(markdown): Don't include next heading in previous heading's range
Somehow marksman also does this?

As for treesitter (norg) it may be because treesitter includes the
newline and the next line indent until the next heading, so the line of
the next heading is included in the range of the previous heading. We
manually -1 on the range end line to fix it.
2023-11-24 15:04:18 +08:00
hedy
2d936bce2d docs: Update readme 2023-11-24 14:52:43 +08:00
hedy
e705330e40 feat: Per-tabpage outlines
Closes #37

Almost completely refactored the UI parts outline.nvim to use a Sidebar
object that implements an outline window. In init.lua, we can then store
a table of the outline for each tabpage ID.

When tabs are closed the outline is closed and sidebar reset
responsibly.

This simplifies `init.lua` quite a lot, making it the highest level
control center for the outline elements.

All lua APIs and commands should work as before.
2023-11-24 14:50:24 +08:00
hedy
83dc477af5 Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-23 18:49:35 +08:00
hedy
7187665106 docs: Update changelog 2023-11-23 18:49:12 +08:00
hedyhli
bea285704c Auto generate vim docs 2023-11-23 10:41:23 +00:00
hedy
0c6d97d34a fix(jsx): Show shorthand fragments as "Fragment"
Closes #35

Previously the treesitter javascript parser would treat `<></>`
specially and emit a `jsx_fragment`. We were checking for this type here
(from symbols-outline.nvim), though we did not include `jsx_fragment` in
the parse_ts function to even look for it.

jsx_fragment was recently removed from treesitter parser to reduce
complexity, so we will treat all jsx_element's without a `name` field in
`jsx_opening_element` as the shorthand fragment.

Using "Fragment" as the name in this case makes it look exactly the same
as if the user used `<Fragment></Fragment>` instead.

The check for `jsx_fragment` is still kept in case an older version of
the parser is still used, it can probably be removed next year.

Ref:
- tree-sitter/tree-sitter-javascript#227
2023-11-23 18:39:35 +08:00
hedy
9c54fe1bcf docs: Fix indented list in readme 2023-11-22 22:32:34 +08:00
hedyhli
3d24bc2074 Auto generate vim docs 2023-11-22 14:26:18 +00:00
hedy
ab6587d25f Merge branch 'main' of github.com:hedyhli/outline.nvim 2023-11-22 22:25:47 +08:00