diff --git a/LSP_TRACKER.md b/LSP_TRACKER.md index a966487a..5f694170 100644 --- a/LSP_TRACKER.md +++ b/LSP_TRACKER.md @@ -56,7 +56,7 @@ - [x] `documentation` <- both string and markup content - [x] `deprecated` - [ ] `preselect` -- [ ] `sortText` +- [x] `sortText` - [x] `filterText` - [x] `insertText` - [x] `insertTextFormat` <- regular or snippet diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..e330f78c --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +node_modules +.vitepress/cache diff --git a/docs/.prettierrc b/docs/.prettierrc new file mode 100644 index 00000000..31ba22d8 --- /dev/null +++ b/docs/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 120 +} diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts new file mode 100644 index 00000000..30a681f5 --- /dev/null +++ b/docs/.vitepress/config.mts @@ -0,0 +1,53 @@ +import { defineConfig } from 'vitepress' +import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: 'Blink Completion (blink.cmp)', + description: 'Performant, batteries-included completion plugin for Neovim', + base: '/cmp/', + sitemap: { hostname: 'https://blink.saghen.dev/cmp' }, + head: [['link', { rel: 'icon', href: '/favicon.png' }]], + themeConfig: { + sidebar: [ + { text: 'Introduction', link: '/' }, + { text: 'Installation', link: '/installation' }, + { + text: 'Configuration', + items: [ + { text: 'General', link: '/configuration/general' }, + { text: 'Appearance', link: '/configuration/appearance' }, + { text: 'Completion', link: '/configuration/completion' }, + { text: 'Keymap', link: '/configuration/keymap' }, + { text: 'Signature', link: '/configuration/signature' }, + { text: 'Sources', link: '/configuration/sources' }, + { text: 'Snippets', link: '/configuration/snippets' }, + { text: 'Reference', link: '/configuration/reference' }, + ], + }, + { + text: 'Development', + items: [ + { text: 'Architecture', link: '/development/architecture' }, + { text: 'Writing Sources', link: '/development/writing-sources' }, + ], + }, + ], + + socialLinks: [{ icon: 'github', link: 'https://github.com/saghen/blink.cmp' }], + + search: { + provider: 'local', + }, + }, + + markdown: { + theme: { + light: 'catppuccin-latte', + dark: 'catppuccin-mocha', + }, + config(md) { + md.use(tabsMarkdownPlugin) + }, + }, +}) diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts new file mode 100644 index 00000000..f13e9f9a --- /dev/null +++ b/docs/.vitepress/theme/index.ts @@ -0,0 +1,14 @@ +// https://vitepress.dev/guide/custom-theme +import DefaultTheme from 'vitepress/theme' +import type { Theme } from 'vitepress' +import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' + +import '@catppuccin/vitepress/theme/mocha/blue.css' +import './style.css' + +export default { + extends: DefaultTheme, + enhanceApp({ app }) { + enhanceAppWithTabs(app) + }, +} satisfies Theme diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css new file mode 100644 index 00000000..40354f4f --- /dev/null +++ b/docs/.vitepress/theme/style.css @@ -0,0 +1,9 @@ +/* Wrap text in code blocks */ +code { + white-space: pre-wrap !important; + word-break: break-word !important; +} + +.content-container { + max-width: 800px !important; +} diff --git a/docs/configuration/appearance.md b/docs/configuration/appearance.md new file mode 100644 index 00000000..4c626b12 --- /dev/null +++ b/docs/configuration/appearance.md @@ -0,0 +1,30 @@ +# Appearance + +If you're looking for how to change the appearance of the completion menu, check out the [menu draw configuration](./completion/menu/draw.md). + + +## Highlight groups + +| Group | Default | Description | +| ----- | ------- | ----------- | +| `BlinkCmpMenu` | Pmenu | The completion menu window | +| `BlinkCmpMenuBorder` | Pmenu | The completion menu window border | +| `BlinkCmpMenuSelection` | PmenuSel | The completion menu window selected item | +| `BlinkCmpScrollBarThumb` | PmenuThumb | The scrollbar thumb | +| `BlinkCmpScrollBarGutter` | PmenuSbar | The scrollbar gutter | +| `BlinkCmpLabel` | Pmenu | Label of the completion item | +| `BlinkCmpLabelDeprecated` | NonText | Deprecated label of the completion item | +| `BlinkCmpLabelMatch` | Pmenu | (Currently unused) Label of the completion item when it matches the query | +| `BlinkCmpLabelDetail` | NonText | Label description of the completion item | +| `BlinkCmpLabelDescription` | NonText | Label description of the completion item | +| `BlinkCmpKind` | Special | Kind icon/text of the completion item | +| `BlinkCmpKind` | Special | Kind icon/text of the completion item | +| `BlinkCmpSource` | NonText | Source of the completion item | +| `BlinkCmpGhostText` | NonText | Preview item with ghost text | +| `BlinkCmpDoc` | NormalFloat | The documentation window | +| `BlinkCmpDocBorder` | NormalFloat | The documentation window border | +| `BlinkCmpDocSeparator` | NormalFloat | The documentation separator between doc and detail | +| `BlinkCmpDocCursorLine` | Visual | The documentation window cursor line | +| `BlinkCmpSignatureHelp` | NormalFloat | The signature help window | +| `BlinkCmpSignatureHelpBorder` | NormalFloat | The signature help window border | +| `BlinkCmpSignatureHelpActiveParameter` | LspSignatureActiveParameter | Active parameter of the signature help | diff --git a/docs/configuration/completion.md b/docs/configuration/completion.md new file mode 100644 index 00000000..c44e637c --- /dev/null +++ b/docs/configuration/completion.md @@ -0,0 +1,100 @@ +# Completion + +Blink cmp has *a lot* of configuration options, the following document tries to highlight the ones you'll likely care the most about for each section. For all options, click on the "Go to default configuration" button next to each header. + +## Keyword + +Controls what the plugin considers to be a keyword, used for fuzzy matching and triggering completions. Most notably, the `range` option controls whether the keyword should match against the text before *and* after the cursor, or just before the cursor. + +:::tabs +== Prefix + +== Full + +::: + +## Trigger + +Controls when to request completion items from the sources and show the completion menu. The following options are available, excluding their `show_on` prefix: + +:::tabs +== Keyword +