fix: resolve clippy warnings in lsp module
- Replace map_or(false, ...) with is_none_or(... !=) - Replace explicit auto-derefs (&*Static) with auto-deref (&Static) - Refactor range-indexed loop to iterator with enumerate + skip/take - Suppress deprecated root_path field with allow(deprecated) docs: update README and REQUIREMENTS for streamd lsp - Add streamd lsp to commands table in README - Add Editor Integration section with Zed, Neovim, VS Code snippets - Add R25 LSP requirements (R25a–R25e) to REQUIREMENTS.md
This commit is contained in:
parent
50c592a641
commit
b224620212
3 changed files with 129 additions and 6 deletions
|
|
@ -400,6 +400,7 @@ Provide recursive search through the shard tree:
|
|||
| `streamd edit [n]` | Edit nth file (supports negative indexing for recent files) |
|
||||
| `streamd timesheet` | Generate formatted timesheet report with expected/actual hours |
|
||||
| `streamd completions <shell>` | Generate shell completions (bash, zsh, fish, elvish, powershell) |
|
||||
| `streamd lsp` | Start Language Server Protocol server over stdin/stdout |
|
||||
|
||||
### R21a: Daily Command Behavior
|
||||
|
||||
|
|
@ -471,3 +472,53 @@ Multiple configurations can be merged:
|
|||
- Dimensions are combined (later configs can add new dimensions)
|
||||
- Markers are combined (later configs can add new markers)
|
||||
- This allows base configuration + domain-specific extensions
|
||||
|
||||
---
|
||||
|
||||
## LSP Server
|
||||
|
||||
### R25: LSP Subcommand
|
||||
|
||||
`streamd lsp` starts a Language Server Protocol server over stdin/stdout.
|
||||
|
||||
**Workspace root resolution:**
|
||||
- The base folder is taken from `initializeParams.rootUri` (or `rootPath` as fallback).
|
||||
- R22/R23 global config resolution is bypassed in LSP mode.
|
||||
|
||||
**Passive mode:**
|
||||
- If `.streamd.toml` is absent from the workspace root, the server enters passive mode: all requests return empty results and no diagnostics are published.
|
||||
|
||||
**Config watching:**
|
||||
- The server registers a `workspace/didChangeWatchedFiles` watcher for `.streamd.toml`.
|
||||
- Config is reloaded without restarting the server when `.streamd.toml` changes.
|
||||
|
||||
**Document sync:**
|
||||
- Full-document sync (`TextDocumentSyncKind::FULL`).
|
||||
- Re-parses on `didOpen`, `didChange`, and `didSave`.
|
||||
|
||||
### R25a: LSP Completion
|
||||
|
||||
- Trigger character: `@`
|
||||
- Returns marker names from the merged config (BasicTimesheetConfiguration + TaskConfiguration).
|
||||
- Conditional suggestions: if marker A is on the line and A has placements with `if_with: {B}`, B is offered with higher priority.
|
||||
- Temporal snippets: `@` followed by a digit offers `YYYYMMDD` and `HHMMSS` format snippets (R16).
|
||||
|
||||
### R25b: LSP Diagnostics
|
||||
|
||||
- **File-name format (R15)**: Warning when the file basename does not match `^(\d{8})(?:-(\d{4,6}))?.+\.md$`.
|
||||
- **Timesheet violations (R18)**: Error when a day ends without a break; Warning for overlapping timecards.
|
||||
|
||||
### R25c: LSP Document Symbols
|
||||
|
||||
- Returns the `LocalizedShard` tree as nested `DocumentSymbol` nodes.
|
||||
- Symbol names are derived from marker names or tag names.
|
||||
|
||||
### R25d: LSP Code Actions
|
||||
|
||||
- "Mark task as done": offered on any line containing `@Task` without `@Done`; inserts ` @Done` after `@Task`.
|
||||
|
||||
### R25e: LSP Cross-file Features
|
||||
|
||||
- `workspace/symbol`: searches all `.md` files in base folder (depth 1) for shards matching the query.
|
||||
- `textDocument/references`: finds all occurrences of the `@Marker` under the cursor across the workspace.
|
||||
- `textDocument/rename`: renames an `@Marker` across all files via `WorkspaceEdit`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue