flavor-grenade-lsp
v0.7.3
Published
Language Server Protocol server for Obsidian Flavored Markdown
Readme
Flavor Grenade LSP
Language Server Protocol support for Obsidian-style Markdown vaults and flavor-aware Markdown projects.
Flavor Grenade indexes local Markdown workspaces and provides editor features for wiki-links, embeds, headings, block references, tags, frontmatter, attachments, Markdown links, and structured documents such as changelogs and MADR decision records.
Install
Most users should install the VS Code extension:
The npm package is the language server for LSP-capable editors and extension integrations:
npm install -g flavor-grenade-lsp
flavor-grenade-lspThe server speaks LSP over stdio. Editors should launch the command and perform
the standard initialize handshake over stdin/stdout.
What It Supports
Core Obsidian-style Markdown support:
- Wiki-links:
[[Note]],[[Note|Alias]],[[Note#Heading]], and[[Note#^block-id]] - Embeds for notes, headings, blocks, and local attachments
- Tags, nested tag paths, callouts, YAML frontmatter, aliases, and block anchors
- Markdown inline links, image links, reference labels, and heading anchors
- Opaque-region handling for code, math, comments, and Templater blocks
Flavor-aware Markdown support:
- Auto-detection from Obsidian vault markers, file syntax, and CommonMark
fallback whenever no concrete
.mdfattributesflavor rule applies - Explicit base flavors for Original Markdown, CommonMark, Obsidian, GFM, GLFM, Pandoc, MultiMarkdown, MDX, kramdown, Markdown Extra, R Markdown, Reddit, and Stack Overflow Markdown
- Structured profile flags for Keep a Changelog, Common Changelog, and MADR layered over any base flavor
Editor Features
- Completions for notes, headings, block anchors, tags, callouts, embeds, attachments, Markdown flavor snippets, and structured-profile headings
- Diagnostics for broken links, ambiguous targets, malformed wiki-links, broken embeds or attachments, missing block anchors, non-breaking spaces, malformed frontmatter, and structured-profile issues
- Go to definition, find references, document highlights, document links, document symbols, workspace symbols, folding ranges, selection ranges, semantic tokens, hovers, code lens, and rename
- Code actions for creating missing notes, fixing non-breaking spaces, generating tables of contents, and moving inline tags to frontmatter
- Vault-confined file-operation planning for safe rename workflows
Vault And Project Detection
Flavor Grenade detects a project by walking upward from an opened Markdown file. The strongest signals are:
.obsidian/.mdfignore.mdfattributes
.mdfignore hides matching Markdown from Flavor Grenade entirely. Hidden files
are not processed, indexed, completed, diagnosed, navigated, renamed, or used as
references unless a later negated rule re-includes them.
.mdfattributes stores repository-tracked flavor and structured-profile rules
using Git-style pattern matching. Rules cascade through subdirectories; later
matching rules win; !flavor clears the effective flavor selected so far; and
flavor=auto explicitly asks Auto Detect to run.
Example .mdfattributes:
*.md flavor=auto
docs/github/*.md flavor=gfm
docs/decisions/*.md flavor=commonmark structured_profiles=madr
CHANGELOG.md flavor=auto structured_profiles=keep-a-changelogExample .mdfignore:
generated/
private/
!private/README.mdWhen no .mdfignore or .mdfattributes applies, Auto Detect remains the default
for the opened directory and all subdirectories. It uses Obsidian vault evidence
and syntax signals, then falls back to CommonMark for generic Markdown.
Security Model
Flavor Grenade treats workspace files as local user data.
- It does not make network calls during indexing, diagnostics, completion, or navigation.
- It returns LSP workspace edits for client approval instead of directly editing vault files.
- It rejects non-file root URIs, unsupported URI schemes, prototype-polluting JSON-RPC payloads, and paths outside the detected vault boundary.
- It applies parser and scan limits for large or adversarial local files.
Develop
Install root dependencies:
bun installRun server checks:
bun run build
bun run typecheck
bun run lint
bun test
bun run bddRun VS Code extension checks:
cd extension
npm install
npm run compile
npm test
npm run test:hostRepository Layout
src/: TypeScript language serverextension/: VS Code extension client and Marketplace packagedocs/: server requirements, design, BDD, DDD, ADRs, research, and plansextension/docs/: extension-specific docswebsite/: public documentation website
License
MIT
