-
-
Notifications
You must be signed in to change notification settings - Fork 23
Contributing
Thank you for your interest in contributing to cord.nvim! This document provides guidelines for contributing to the project.
- Fork and branch from
master. - Style:
- Lua: format with
styluaand lint withluacheck. - Rust: format with
cargo fmt --alland lint withcargo clippy --all-targets --all-features.
- Lua: format with
- If your changes affect the server component, build the binary from source.
- Update docs when your change affects behavior or config.
- Submit a PR with a clear overview and description of your changes. PR title and commits must follow Conventional Commits spec.
If you're new to contributing in general, we recommend starting small by improving the documentation or finding missing mappings and adding them to the appropriate mappings table.
The Neovim-side implementation: configuration, activity detection, hooks, built-in plugins, and orchestration with the server.
Expand
-
lua/cord/api/-
config/: Runtime config layer, defaults and validation. -
log/: Logging backends-
init.lua: Logger facade. -
file.lua: File logger. -
notify.lua::messageslogger.
-
-
command.lua::Cord ...user commands. -
icon.lua: Icon API.
-
-
lua/cord/core/-
async/: Async/Futures helpers on top of coroutines. -
uv/: Thin wrappers over libuv based on the Futures system above. -
util/: Utility functions used throughout the codebase.
-
-
lua/cord/internal/-
activity/-
builder.lua: Aggregates the activity subsystem, builds the Activity object. -
mappings.lua: Buffer/filetype/context mappings. -
workspace.lua: Workspace discovery from root markers (.git,.hg,.svn, etc.).
-
-
constants/: Constants and enums used across the plugin. -
manager.lua: Builds/schedules/sends activities; idle handling; queueing. -
hooks.lua: Hook registration and execution used by the manager.
-
-
lua/cord/plugins/: Built-in plugins.-
init.lua: Plugin API.
-
-
lua/cord/server/-
init.lua: High-level server lifecycle: connect, restart, shutdown, and integration with events. -
ipc/: Message bus between Lua and Rust server. -
spawn/: Spawning the server process. -
update/: Fetch/build/update the server executable. -
fs/: Server-related path management.
-
Discord IPC, message protocol, session management, cross-platform pipes and some other features that require a common server between instances.
Expand
-
cord.rs: Server runtime: session lifecycle, event loop, and client coordination. -
cli/: CLI arguments and error handling. -
ipc/-
discord/: Discord RPC client. -
pipe/: Cross-platform pipe layer used to communicate with Neovim Lua plugin.
-
-
messages/Events/messages.-
events/client/: Messages from Lua -> server (connect,initialize,update_activity,clear_activity,disconnect,shutdown). -
events/server/: Messages from server -> Lua (ready,log,disconnect). -
events/local/: Internal messaging.
-
-
presence/Discord Rich Presence models.-
activity.rs: Activity object. -
packet.rs: Packet with the Activity object.
-
-
protocol/-
json/andmsgpack/: Serialization/deserialization.
-
-
session/: Session management (one server for multiple Neovim instances). -
types/: Shared types, including the config struct. -
util/: Lockfile (to enforce single instance), logger, macros, and other utils.
-
.github/wiki/: Documentation source which is published to GitHub Wiki pages.
- See vyfor/icons.
-
Clone the repositoy:
git clone https://github.com/vyfor/cord.nvim
-
Load the plugin, this is easiest with a plugin manager (e.g.
lazy.nvim):
{
'vyfor/cord.nvim',
dir = 'path/to/cloned/cord.nvim',
-- comment this out if you're working on the server component
-- see https://github.com/vyfor/cord.nvim/wiki/Build
build = ':Cord update',
}If something work as expected, it's always a good idea to check the logs. See https://github.com/vyfor/cord.nvim/wiki/FAQ#q-how-to-see-the-logs.
- PATCH: Non-breaking changes.
- MINOR: Breaking changes.
- MAJOR: Significant rewrites or fundamental shifts, bumped manually.