feat(providers): Support independent configs for each provider to handle

Closes #58
This commit is contained in:
hedy
2024-03-16 08:12:50 +08:00
parent 8c6b11e4c2
commit b64c0c66d4
7 changed files with 39 additions and 6 deletions

View File

@@ -359,10 +359,15 @@ Pass a table to the setup call with your configuration options.
providers = {
priority = { 'lsp', 'coc', 'markdown', 'norg' },
-- Configuration for each provider (3rd party providers are supported)
lsp = {
-- Lsp client names to ignore
blacklist_clients = {},
},
markdown = {
-- List of supported ft's to use the markdown provider
filetypes = {'markdown'},
},
},
symbols = {
@@ -494,10 +499,14 @@ path, for use as a provider.
External providers from plugins should define the provider module at
`lua/outline/providers/<name>.lua` with these functions:
- `supports_buffer(bufnr: integer) -> boolean`
- `supports_buffer(bufnr: integer, config: table?) -> boolean`
This function could check buffer filetype, existence of required modules, etc.
The config table comes from the user's configuration in the
`providers['provider-name']` table where `provider-name` is the
`require('outline.providers.<name>').name`.
- `get_status() -> string[]` (optional)
Return a list of lines to be included in `:OutlineStatus` as supplementary