Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion docs/editors/emacs.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,37 @@ Emacs 29+ includes built-in support for tree-sitter, providing faster and more a

| Feature | Command / Interaction |
| :--- | :--- |
| **Hover** | Displayed in Echo Area / ElDoc |
| **Hover** | `M-x eldoc` (or automatic via ElDoc) |
| **Go to Definition** | `M-.` (`xref-find-definitions`) |
| **Find References** | `M-?` (`xref-find-references`) |
| **Rename** | `M-x eglot-rename` or `M-x lsp-rename` |
| **Code Actions** | `M-x eglot-code-actions` or `s-l a` (lsp-mode) |
| **Formatting** | `M-x eglot-format-buffer` or `M-x lsp-format-buffer` |
| **Outline** | `M-x imenu` |

## What Is Available Today

`allium-mode` currently provides:

- Major mode support for `*.allium` files (`allium-mode`).
- Optional tree-sitter major mode (`allium-ts-mode`) on Emacs 29+ when the grammar is installed.
- Syntax highlighting, indentation, and line comments (`-- ...`).
- Imenu support in tree-sitter mode.
- LSP wiring for both `eglot` and `lsp-mode` with language id `allium`.

To access the language features in a buffer:

1. Open an `.allium` file.
2. Ensure your LSP client is active (`eglot-ensure` or `lsp-deferred`).
3. Use standard Emacs/Xref/LSP commands:
- Definition: `M-.`
- References: `M-?`
- Rename: `M-x eglot-rename` or `M-x lsp-rename`
- Code actions: `M-x eglot-code-actions` or `M-x lsp-execute-code-action`
- Format: `M-x eglot-format-buffer` or `M-x lsp-format-buffer`

There are no custom allium-specific interactive commands at the moment; features are accessed through standard `xref`, `eldoc`, and your chosen LSP client commands.

## Troubleshooting

- **Server not found**: Run `M-x executable-find RET allium-lsp RET` to ensure Emacs can see the binary.
Expand Down
25 changes: 25 additions & 0 deletions docs/editors/neovim.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,31 @@ npm run test:nvim:integration
| **Formatting** | Format current buffer | `<leader>f` |
| **Diagnostics** | Show inline errors and warnings | `[d` / `]d` |

## What Is Available Today

`nvim-allium` currently provides:

- Filetype + LSP client wiring for `allium` buffers.
- Default LSP keymaps on attach.
- Tree-sitter parser registration for `allium` (local grammar path in this repo).
- Health checks via `:checkhealth allium`.

To access functionality in a buffer:

1. Open an `.allium` file.
2. Confirm filetype: `:set filetype?` should show `filetype=allium`.
3. Confirm LSP attached: `:LspInfo`.
4. Use default keymaps or standard LSP commands:
- Hover: `K` or `:lua vim.lsp.buf.hover()`
- Definition: `gd` or `:lua vim.lsp.buf.definition()`
- References: `gr` or `:lua vim.lsp.buf.references()`
- Rename: `<leader>rn` or `:lua vim.lsp.buf.rename()`
- Code actions: `<leader>ca` or `:lua vim.lsp.buf.code_action()`
- Format: `<leader>f` or `:lua vim.lsp.buf.format({ async = true })`
- Diagnostics nav: `[d` / `]d`, list via `<leader>q`

There are no extra user commands defined by `nvim-allium` at the moment; functionality is exposed through built-in Neovim LSP and diagnostic APIs plus configured keymaps.

## Troubleshooting

- **LSP not starting**: Ensure `allium-lsp` is in your `$PATH`. You can test this by running `allium-lsp --version` in your terminal.
Expand Down
22 changes: 22 additions & 0 deletions packages/allium-mode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ In `config.el`:
- LSP integration via `eglot` or `lsp-mode`.
- Tree-sitter support for Emacs 29+.

## Using Plugin Functionality

`allium-mode` intentionally uses standard Emacs LSP/Xref commands rather than
adding many custom commands.

After opening an `.allium` file and connecting LSP (`eglot-ensure` or
`lsp-deferred`), you can use:

- Hover: `M-x eldoc` (or automatic ElDoc display)
- Go to definition: `M-.` (`xref-find-definitions`)
- Find references: `M-?` (`xref-find-references`)
- Rename symbol: `M-x eglot-rename` or `M-x lsp-rename`
- Code actions: `M-x eglot-code-actions` or `M-x lsp-execute-code-action`
- Format buffer: `M-x eglot-format-buffer` or `M-x lsp-format-buffer`
- Outline navigation: `M-x imenu` (with richer structure in `allium-ts-mode`)

Built-in mode commands and variables:

- Switch modes: `M-x allium-mode` / `M-x allium-ts-mode`
- Indentation width: customize `allium-indent-offset`
- LSP server command: customize `allium-lsp-server-command`

## Quick Demo (Isolated `-Q` Session)

You can try allium-mode quickly in a clean Emacs session without touching your
Expand Down
21 changes: 21 additions & 0 deletions packages/nvim-allium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ Neovim integration for the Allium language, providing LSP and Tree-sitter suppor
- Tree-sitter syntax highlighting, indents, and folds.
- Diagnostic reporting and quick fixes.

## Using Plugin Functionality

`nvim-allium` uses standard Neovim LSP/diagnostic functions with default
keymaps configured on LSP attach.

After opening an `.allium` file and confirming LSP is attached (`:LspInfo`):

- Hover: `K` or `:lua vim.lsp.buf.hover()`
- Go to definition: `gd` or `:lua vim.lsp.buf.definition()`
- Find references: `gr` or `:lua vim.lsp.buf.references()`
- Rename symbol: `<leader>rn` or `:lua vim.lsp.buf.rename()`
- Code actions: `<leader>ca` or `:lua vim.lsp.buf.code_action()`
- Format buffer: `<leader>f` or `:lua vim.lsp.buf.format({ async = true })`
- Diagnostic navigation: `[d` / `]d`
- Diagnostic location list: `<leader>q`

Built-in plugin options are configured via `require("allium").setup({...})`:

- `lsp.cmd`, `lsp.filetypes`, `lsp.root_dir`, `lsp.settings`
- `keymaps.enabled` and individual keymap overrides

## Quick Demo (Isolated Neovim Session)

You can try `nvim-allium` in an isolated Neovim environment that does not touch
Expand Down