🐻 minimal ui2 fuzzy finder for Neovim codeberg.org/comfysage/artio.nvim
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(builtins): add `document_symbols` builtin

robin cd9ab579 0ec6ad1f

+33
+33
lua/artio/builtins.lua
··· 714 714 ) 715 715 end 716 716 717 + builtins.document_symbols = function(props) 718 + props = props or {} 719 + 720 + local buf = vim.api.nvim_get_current_buf() 721 + local win = vim.api.nvim_get_current_win() 722 + 723 + vim.lsp.buf.document_symbol({ 724 + on_list = function(what) 725 + local lst = what.items 726 + 727 + return artio.select(lst, { 728 + prompt = "document_symbols", 729 + format_item = function(v) 730 + return v.text 731 + end, 732 + preview_item = function(v) 733 + return { 734 + buf = buf, 735 + pos = { v.lnum, v.col }, 736 + pos_end = { v.end_lnum, v.end_col }, 737 + } 738 + end, 739 + }, function(v, _) 740 + if not v then 741 + return 742 + end 743 + 744 + vim.api.nvim_win_set_cursor(win, { v.lnum, v.col }) 745 + end, props) 746 + end, 747 + }) 748 + end 749 + 717 750 return builtins