tinymist/editors/neovim/CONTRIBUTING.md
Copilot fee9b27e00
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
docs: add Neovim specification and canonical implementation documentation (#2082)
This PR adds comprehensive documentation for the Neovim Tinymist plugin,
establishing it as the canonical implementation of a Tinymist editor
language client.

## Changes Made

### Added `editors/neovim/Specification.md`
The specification was a mess, so I the reviewer deleted it.

### Enhanced `editors/neovim/CONTRIBUTING.md`
Expanded the contributing guide to document:
- **Canonical Implementation Status**: Establishes this as the
heavily-documented reference implementation for other editors
- **Bootstrap Script Commands**: 
  - `./bootstrap.sh editor` - Interactive editing experience in Docker
  - `./bootstrap.sh test` - Headless test execution
  - `./bootstrap.sh bash` - Development shell access
- **Test Suite Structure**: Overview of all spec files and their testing
purposes
- **Contribution Patterns**: Guidelines for maintaining the reference
implementation

### Updated `.github/copilot-instructions.md`
Added guidance for working with editor integrations:
- **Repository Structure**: Notes the Neovim plugin as canonical
implementation with documentation links
- **Editor Integration Guidelines**: New section specifically for
referencing Neovim patterns
- **Development Workflow**: References to bootstrap commands and
documentation

## Why This Matters

The Neovim plugin now serves as the **canonical implementation** that
other editor integrations can reference for:
- LSP client setup patterns and configuration handling
- Event subscription mechanisms for development events
- Project resolution modes (singleFile vs lockDatabase)
- Export functionality patterns (onSave, onType, never)
- Comprehensive test coverage examples

This documentation enables maintainers and contributors to understand
the complete scope of the Neovim integration and provides a reference
for implementing similar functionality in other editors.

Fixes #2081.

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/Myriad-Dreamin/tinymist/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-25 11:48:23 +08:00

1.9 KiB

Contributing

This guide extends the root CONTRIBUTING.md file with editor-specific information for Neovim integrations.

Canonical Implementation

The Neovim Tinymist plugin serves as the heavily-documented canonical implementation of an editor language client for Tinymist. This means:

  • Reference Implementation: Other editors should refer to this implementation for LSP client patterns, configuration handling, and event subscription mechanisms
  • Comprehensive Test Suite: Complete spec coverage in spec/ directory demonstrates expected behavior
  • Documentation: Detailed Specification.md documents all functionality and APIs

Development Workflow

Interactive Editor Mode

./bootstrap.sh editor

Enters interactive edit mode for human experiencing the spec implementation. This launches Neovim in a Docker container with the plugin loaded, allowing you to:

  • Test functionality manually
  • Explore LSP features interactively
  • Debug issues in a controlled environment
  • Experience the canonical implementation first-hand

Headless Testing

./bootstrap.sh test

Runs headless tests for automated validation. This executes the complete test suite including:

  • LSP client attachment tests
  • Export functionality validation
  • Project resolution testing
  • Event subscription verification
  • All spec files in spec/*_spec.lua

Contributing Guidelines

When contributing to the Neovim plugin:

  1. Add tests first: Write spec tests for new functionality
  2. Follow patterns: Use existing test patterns from helpers.lua and fixtures.lua
  3. Update documentation: Modify Specification.md for API changes
  4. Test thoroughly: Run ./bootstrap.sh test to validate changes
  5. Add todo and skip if asserts in test or spec file are not met. The todo is a reminder to fix the test in other PRs.