MAJOR: Project rename and preparation for v1.0.0
I hope I haven't missed any for the renames!
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local main = require 'symbols-outline'
|
||||
local main = require 'outline'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -30,7 +30,7 @@ M.defaults = {
|
||||
show_relative_numbers = false,
|
||||
show_cursorline = true,
|
||||
hide_cursor = false,
|
||||
winhl = "SymbolsOutlineDetails:Comment,SymbolsOutlineLineno:LineNr",
|
||||
winhl = "OutlineDetails:Comment,OutlineLineno:LineNr",
|
||||
},
|
||||
preview_window = {
|
||||
auto_preview = false,
|
||||
@@ -195,7 +195,7 @@ end
|
||||
|
||||
function M.check_config()
|
||||
if M.o.outline_window.hide_cursor and not M.o.outline_window.show_cursorline then
|
||||
vim.notify("[symbols-outline.config]: hide_cursor enabled WITHOUT cursorline enabled!", vim.log.levels.ERROR)
|
||||
vim.notify("[outline.config]: hide_cursor enabled WITHOUT cursorline enabled!", vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local M = {}
|
||||
local cfg = require 'symbols-outline.config'
|
||||
local cfg = require 'outline.config'
|
||||
|
||||
M.is_foldable = function(node)
|
||||
return node.children and #node.children > 0
|
||||
@@ -1,5 +1,5 @@
|
||||
local so = require 'symbols-outline'
|
||||
local cfg = require 'symbols-outline.config'
|
||||
local so = require 'outline'
|
||||
local cfg = require 'outline.config'
|
||||
local util = vim.lsp.util
|
||||
|
||||
local M = {}
|
||||
@@ -1,11 +1,11 @@
|
||||
local parser = require 'symbols-outline.parser'
|
||||
local providers = require 'symbols-outline.providers.init'
|
||||
local ui = require 'symbols-outline.ui'
|
||||
local writer = require 'symbols-outline.writer'
|
||||
local cfg = require 'symbols-outline.config'
|
||||
local utils = require 'symbols-outline.utils.init'
|
||||
local View = require 'symbols-outline.view'
|
||||
local folding = require 'symbols-outline.folding'
|
||||
local parser = require 'outline.parser'
|
||||
local providers = require 'outline.providers.init'
|
||||
local ui = require 'outline.ui'
|
||||
local writer = require 'outline.writer'
|
||||
local cfg = require 'outline.config'
|
||||
local utils = require 'outline.utils.init'
|
||||
local View = require 'outline.view'
|
||||
local folding = require 'outline.folding'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -35,7 +35,7 @@ local function setup_global_autocmd()
|
||||
|
||||
vim.api.nvim_create_autocmd('WinEnter', {
|
||||
pattern = '*',
|
||||
callback = require('symbols-outline.preview').close,
|
||||
callback = require('outline.preview').close,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -154,12 +154,12 @@ local function setup_buffer_autocmd()
|
||||
if cfg.o.preview_window.auto_preview then
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
buffer = 0,
|
||||
callback = require('symbols-outline.preview').show,
|
||||
callback = require('outline.preview').show,
|
||||
})
|
||||
else
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
buffer = 0,
|
||||
callback = require('symbols-outline.preview').close,
|
||||
callback = require('outline.preview').close,
|
||||
})
|
||||
end
|
||||
if cfg.o.outline_window.auto_goto then
|
||||
@@ -321,27 +321,27 @@ local function setup_keymaps(bufnr)
|
||||
-- hover symbol
|
||||
map(
|
||||
cfg.o.keymaps.hover_symbol,
|
||||
require('symbols-outline.hover').show_hover
|
||||
require('outline.hover').show_hover
|
||||
)
|
||||
-- preview symbol
|
||||
map(
|
||||
cfg.o.keymaps.toggle_preview,
|
||||
require('symbols-outline.preview').toggle
|
||||
require('outline.preview').toggle
|
||||
)
|
||||
-- rename symbol
|
||||
map(
|
||||
cfg.o.keymaps.rename_symbol,
|
||||
require('symbols-outline.rename').rename
|
||||
require('outline.rename').rename
|
||||
)
|
||||
-- code actions
|
||||
map(
|
||||
cfg.o.keymaps.code_actions,
|
||||
require('symbols-outline.code_action').show_code_actions
|
||||
require('outline.code_action').show_code_actions
|
||||
)
|
||||
-- show help
|
||||
map(
|
||||
cfg.o.keymaps.show_help,
|
||||
require('symbols-outline.config').show_help
|
||||
require('outline.config').show_help
|
||||
)
|
||||
-- close outline
|
||||
map(cfg.o.keymaps.close, function()
|
||||
@@ -414,7 +414,7 @@ function M.follow_cursor(opts)
|
||||
return false
|
||||
end
|
||||
|
||||
if require('symbols-outline.preview').has_code_win() then
|
||||
if require('outline.preview').has_code_win() then
|
||||
M._highlight_current_item(M.state.code_win)
|
||||
else
|
||||
return false
|
||||
@@ -461,7 +461,7 @@ function M.toggle_outline(opts)
|
||||
end
|
||||
end
|
||||
|
||||
-- Used for SymbolsOutline user command
|
||||
-- Used for Outline user command
|
||||
local function _cmd_toggle_outline(opts)
|
||||
if opts.bang then
|
||||
M.toggle_outline({ focus_outline = false })
|
||||
@@ -479,7 +479,7 @@ function M.open_outline(opts)
|
||||
if not M.view:is_open() then
|
||||
local found = providers.request_symbols(handler, opts)
|
||||
if not found then
|
||||
vim.notify("[symbols-outline]: No providers found for current buffer", vim.log.levels.WARN)
|
||||
vim.notify("[outline]: No providers found for current buffer", vim.log.levels.WARN)
|
||||
-- else
|
||||
-- print("Using provider ".._G._symbols_outline_current_provider.name.."...")
|
||||
end
|
||||
@@ -512,7 +512,7 @@ end
|
||||
---Set cursor to focus on the code window, return whether this operation was successful.
|
||||
---@return boolean ok Whether it was successful. If unsuccessful, it might mean that the attached code window has been closed or is no longer valid.
|
||||
function M.focus_code()
|
||||
if require('symbols-outline.preview').has_code_win() then
|
||||
if require('outline.preview').has_code_win() then
|
||||
vim.fn.win_gotoid(M.state.code_win)
|
||||
return true
|
||||
end
|
||||
@@ -522,7 +522,7 @@ end
|
||||
---Toggle focus between outline and code window, returns whether it was successful.
|
||||
---@return boolean ok Whether it was successful. If `ok=false`, either the outline window is not open or the code window is no longer valid.
|
||||
function M.focus_toggle()
|
||||
if M.view:is_open() and require('symbols-outline.preview').has_code_win() then
|
||||
if M.view:is_open() and require('outline.preview').has_code_win() then
|
||||
local winid = vim.fn.win_getid()
|
||||
if winid == M.state.code_win then
|
||||
vim.fn.win_gotoid(M.view.winnr)
|
||||
@@ -550,7 +550,7 @@ function M.show_status()
|
||||
else
|
||||
print("Outline window is not open.")
|
||||
end
|
||||
if require('symbols-outline.preview').has_code_win() then
|
||||
if require('outline.preview').has_code_win() then
|
||||
print("Code window is active.")
|
||||
else
|
||||
print("Warning: code window is either closed or invalid. Please close and reopen the outline window.")
|
||||
@@ -572,7 +572,7 @@ end
|
||||
|
||||
local function setup_commands()
|
||||
local cmd = function(n, c, o)
|
||||
vim.api.nvim_create_user_command('SymbolsOutline'..n, c, o)
|
||||
vim.api.nvim_create_user_command('Outline'..n, c, o)
|
||||
end
|
||||
|
||||
cmd('', _cmd_toggle_outline, {
|
||||
@@ -602,7 +602,7 @@ With bang, don't switch cursor focus to outline window.",
|
||||
})
|
||||
end
|
||||
|
||||
---Set up configuration options for symbols-outline.
|
||||
---Set up configuration options for outline.
|
||||
function M.setup(opts)
|
||||
cfg.setup(opts)
|
||||
ui.setup_highlights()
|
||||
@@ -1,9 +1,9 @@
|
||||
local symbols = require 'symbols-outline.symbols'
|
||||
local ui = require 'symbols-outline.ui'
|
||||
local cfg = require 'symbols-outline.config'
|
||||
local t_utils = require 'symbols-outline.utils.table'
|
||||
local lsp_utils = require 'symbols-outline.utils.lsp_utils'
|
||||
local folding = require 'symbols-outline.folding'
|
||||
local symbols = require 'outline.symbols'
|
||||
local ui = require 'outline.ui'
|
||||
local cfg = require 'outline.config'
|
||||
local t_utils = require 'outline.utils.table'
|
||||
local lsp_utils = require 'outline.utils.lsp_utils'
|
||||
local folding = require 'outline.folding'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -113,7 +113,7 @@ function M.get_lines(flattened_outline_items)
|
||||
node_line,
|
||||
from,
|
||||
to,
|
||||
'SymbolsOutlineConnector',
|
||||
'OutlineConnector',
|
||||
})
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local so = require 'symbols-outline'
|
||||
local cfg = require 'symbols-outline.config'
|
||||
local hover = require 'symbols-outline.hover'
|
||||
local so = require 'outline'
|
||||
local cfg = require 'outline.config'
|
||||
local hover = require 'outline.hover'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -28,7 +28,7 @@ local function convert_symbols(result)
|
||||
local s = {}
|
||||
local kinds_index = {}
|
||||
-- create a inverse indexing of symbols.kind
|
||||
local symbols = require("symbols-outline.symbols")
|
||||
local symbols = require("outline.symbols")
|
||||
for k, v in pairs(symbols.kinds) do
|
||||
kinds_index[v] = k
|
||||
end
|
||||
@@ -1,9 +1,9 @@
|
||||
local M = {}
|
||||
|
||||
local providers = {
|
||||
'symbols-outline/providers/nvim-lsp',
|
||||
'symbols-outline/providers/coc',
|
||||
'symbols-outline/providers/markdown',
|
||||
'outline/providers/nvim-lsp',
|
||||
'outline/providers/coc',
|
||||
'outline/providers/markdown',
|
||||
}
|
||||
|
||||
_G._symbols_outline_current_provider = nil
|
||||
@@ -1,4 +1,4 @@
|
||||
local md_parser = require 'symbols-outline.markdown'
|
||||
local md_parser = require 'outline.markdown'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local config = require 'symbols-outline.config'
|
||||
local lsp_utils = require 'symbols-outline.utils.lsp_utils'
|
||||
local jsx = require 'symbols-outline.utils.jsx'
|
||||
local config = require 'outline.config'
|
||||
local lsp_utils = require 'outline.utils.lsp_utils'
|
||||
local jsx = require 'outline.utils.jsx'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local so = require 'symbols-outline'
|
||||
local so = require 'outline'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local cfg = require 'symbols-outline.config'
|
||||
local cfg = require 'outline.config'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -59,7 +59,7 @@ function M.icon_from_kind(kind)
|
||||
if cfg.o.symbols.icon_source == 'lspkind' then
|
||||
local has_lspkind, lspkind = pcall(require, 'lspkind')
|
||||
if not has_lspkind then
|
||||
vim.notify("[symbols-outline]: icon_source set to lspkind but failed to require lspkind!", vim.log.levels.ERROR)
|
||||
vim.notify("[outline]: icon_source set to lspkind but failed to require lspkind!", vim.log.levels.ERROR)
|
||||
else
|
||||
local icon = lspkind.symbolic(kindstr, { with_text = false })
|
||||
if icon and icon ~= "" then
|
||||
@@ -10,7 +10,7 @@ function M.add_hover_highlight(bufnr, line, col_start)
|
||||
vim.api.nvim_buf_add_highlight(
|
||||
bufnr,
|
||||
M.hovered_hl_ns,
|
||||
'SymbolsOutlineCurrent',
|
||||
'OutlineCurrent',
|
||||
line,
|
||||
col_start,
|
||||
-1
|
||||
@@ -18,15 +18,15 @@ function M.add_hover_highlight(bufnr, line, col_start)
|
||||
end
|
||||
|
||||
function M.setup_highlights()
|
||||
-- Setup the SymbolsOutlineCurrent highlight group if it hasn't been done already by
|
||||
-- Setup the OutlineCurrent highlight group if it hasn't been done already by
|
||||
-- a theme or manually set
|
||||
if vim.fn.hlexists 'SymbolsOutlineCurrent' == 0 then
|
||||
if vim.fn.hlexists 'OutlineCurrent' == 0 then
|
||||
local cline_hl = vim.api.nvim_get_hl_by_name('CursorLine', true)
|
||||
local string_hl = vim.api.nvim_get_hl_by_name('String', true)
|
||||
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'SymbolsOutlineCurrent',
|
||||
'OutlineCurrent',
|
||||
{ bg = cline_hl.background, fg = string_hl.foreground }
|
||||
)
|
||||
end
|
||||
@@ -41,9 +41,9 @@ function M.setup_highlights()
|
||||
'gui'
|
||||
)
|
||||
|
||||
if vim.fn.hlexists 'SymbolsOutlineConnector' == 0 then
|
||||
if vim.fn.hlexists 'OutlineConnector' == 0 then
|
||||
vim.cmd(
|
||||
string.format('hi SymbolsOutlineConnector guifg=%s', comment_fg_gui)
|
||||
string.format('hi OutlineConnector guifg=%s', comment_fg_gui)
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
local config = require 'symbols-outline.config'
|
||||
local tbl_utils = require 'symbols-outline.utils.table'
|
||||
local config = require 'outline.config'
|
||||
local tbl_utils = require 'outline.utils.table'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local cfg = require('symbols-outline.config')
|
||||
local cfg = require('outline.config')
|
||||
|
||||
local View = {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local parser = require 'symbols-outline.parser'
|
||||
local cfg = require('symbols-outline.config')
|
||||
local ui = require 'symbols-outline.ui'
|
||||
local parser = require 'outline.parser'
|
||||
local cfg = require('outline.config')
|
||||
local ui = require 'outline.ui'
|
||||
|
||||
local M = {}
|
||||
|
||||
@@ -13,7 +13,7 @@ local function is_buffer_outline(bufnr)
|
||||
return string.match(name, 'OUTLINE') ~= nil and ft == 'Outline'
|
||||
end
|
||||
|
||||
local hlns = vim.api.nvim_create_namespace 'symbols-outline-icon-highlight'
|
||||
local hlns = vim.api.nvim_create_namespace 'outline-icon-highlight'
|
||||
|
||||
function M.write_outline(bufnr, lines)
|
||||
if not is_buffer_outline(bufnr) then
|
||||
@@ -46,7 +46,7 @@ function M.add_highlights(bufnr, hl_info, nodes)
|
||||
M.add_hover_highlights(bufnr, nodes)
|
||||
end
|
||||
|
||||
local ns = vim.api.nvim_create_namespace 'symbols-outline-virt-text'
|
||||
local ns = vim.api.nvim_create_namespace 'outline-virt-text'
|
||||
|
||||
function M.write_details(bufnr, lines)
|
||||
if not is_buffer_outline(bufnr) then
|
||||
@@ -58,7 +58,7 @@ function M.write_details(bufnr, lines)
|
||||
|
||||
for index, value in ipairs(lines) do
|
||||
vim.api.nvim_buf_set_extmark(bufnr, ns, index - 1, -1, {
|
||||
virt_text = { { value, 'SymbolsOutlineDetails' } },
|
||||
virt_text = { { value, 'OutlineDetails' } },
|
||||
virt_text_pos = 'eol',
|
||||
hl_mode = 'combine',
|
||||
})
|
||||
@@ -77,7 +77,7 @@ function M.write_lineno(bufnr, lines, max)
|
||||
for index, value in ipairs(lines) do
|
||||
local leftpad = string.rep(' ', maxwidth-#value)
|
||||
vim.api.nvim_buf_set_extmark(bufnr, ns, index - 1, -1, {
|
||||
virt_text = { {leftpad..value, 'SymbolsOutlineLineno' } },
|
||||
virt_text = { {leftpad..value, 'OutlineLineno' } },
|
||||
virt_text_pos = 'overlay',
|
||||
virt_text_win_col = 0,
|
||||
hl_mode = 'combine',
|
||||
Reference in New Issue
Block a user