Skip to content

Conversation

@retran
Copy link
Owner

@retran retran commented Oct 29, 2025

Summary

This pull request introduces significant developer experience improvements, focusing on TypeScript and Lua development within meowvim. It overhauls the nvim-cmp configuration to provide richer, context-aware completions for the Neovim Lua API and command line, and dramatically enhances the tsserver LSP with advanced inlay hints and a dedicated "organize imports" feature. Additionally, it integrates a new, comprehensive .meowg1k.yml configuration to provide powerful, project-specific AI assistance for tasks like code review, documentation, and commit generation.

Motivation

  • Problem: The existing TypeScript support lacked advanced, productivity-boosting features like rich inlay hints and a simple command for organizing imports. Lua completion was generic and unaware of the Neovim API, and the previous AI tooling configuration was outdated and less powerful.
  • User Impact: This update provides a more intelligent and efficient coding environment. TypeScript developers will benefit from improved code readability and a streamlined workflow for managing imports. All users will experience smarter code completion, especially when configuring Neovim in Lua or using the command line. The new AI integration offers powerful, context-aware assistance, accelerating common development tasks.
  • Timing: As LSP and completion engines evolve, it's crucial to adopt new features to keep meowvim a top-tier, productivity-focused distribution. Integrating a more powerful AI configuration aligns with modern development trends and enhances the project's own development workflow.
  • Alternatives: For organizing imports, we could have relied solely on format-on-save, but a dedicated command offers more granular control. For AI, we could have continued with the old configuration, but the new format provides far more tailored and powerful prompts specific to meowvim's architecture.

Changes

Plugin Configuration

  • lua/plugins/nvim-cmp.lua:

    • Dependencies: Added cmp-nvim-lua, cmp-cmdline, and cmp-spell to provide specialized completion sources.
    • Sources: Updated completion sources to include nvim_lua (for Neovim API), spell, and cmdline. The neorg source was removed as it is less commonly used.
    • UI: Added a format_kinds function to display icons next to completion items, indicating their source (e.g., Copilot, LSP, Lua).
    • Filetype Setup: Introduced filetype-specific configurations to enable nvim_lua completions automatically for Lua files and cmdline completions for the command-line window.
  • lua/plugins/nvim-lspconfig.lua:

    • TSServer: Significantly updated the tsserver configuration for TypeScript/JavaScript.
    • Organize Imports: Added a new keybinding <leader>xo and a user command :LspOrganize to trigger the _typescript.organizeImports code action, cleaning up import statements on demand.
    • Formatting: Disabled the LSP's built-in formatter to ensure conform.nvim remains the single source of truth for formatting.
    • Inlay Hints: Enabled and extensively configured inlay hints for parameter names, variable types, property declarations, and more, greatly improving code readability.
  • lua/plugins/conform.lua:

    • Prettier: Removed the hardcoded --tab-width 2 argument for prettier and prettierd. This allows the formatters to respect project-local .prettierrc configuration files, providing more flexible and conventional behavior.

Core Configuration

  • .meowg1k.yml: Added a new, comprehensive configuration file for the meowg1k AI tool. This file defines:
    • Models: gemini-flash, gemini-pro, and gemini-embeddings.
    • Tasks: Highly detailed, context-aware prompts for generating Lua code reviews, new plugins, documentation, and refactoring, all tailored to meowvim's structure.
    • Commands: Custom prompts for ask, commit, and pullRequest generation.
  • .meowg1k/config.yaml: Removed the old, deprecated AI tool configuration file.

Replaces the legacy `.meowg1k/config.yaml` with the new root `.meowg1k.yml` to align with the latest tool version. This change centralizes and significantly enhances the AI development assistant's capabilities.

The new configuration introduces comprehensive, project-specific prompts for Lua code review, plugin development, refactoring, and documentation. It also defines multiple Gemini model profiles (fast, smart, embeddings) and improves the `ask`, `commit`, and `pullRequest` workflows for meowvim development.
Improves the out-of-the-box experience for TypeScript and JavaScript
by refining LSP, completion, and formatting configurations.

Key changes include:
- **tsserver**:
  - Adds an "Organize Imports" feature, available via `<leader>xo` and the `:LspOrganize` command.
  - Enables extensive inlay hints for parameter names, variable types, and more, providing richer inline context.
  - Disables the built-in LSP formatter, deferring to `conform.nvim` to respect project-local Prettier configurations.
  - Enables `updateImportsOnFileMove` for better refactoring support.

- **nvim-cmp**:
  - Adds new completion sources for Lua (`nvim_lua`) and the command line (`cmdline`), improving the editing experience beyond just TS/JS.
  - Enhances the completion menu with source-specific icons for better readability.

- **conform.nvim**:
  - Removes hardcoded `--tab-width` for Prettier, allowing it to use the settings from a project's `.prettierrc` file.
@retran retran self-assigned this Oct 29, 2025
Copilot AI review requested due to automatic review settings October 29, 2025 19:29
@retran retran added the enhancement New feature or request label Oct 29, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances TypeScript/JavaScript LSP configuration and improves nvim-cmp completion engine with additional sources and better completion behavior. The changes also migrate AI tooling configuration from .meowg1k/config.yaml to .meowg1k.yml and update plugin dependencies.

  • Enhanced TypeScript LSP with organize imports functionality, extended inlay hints, and disabled formatting (delegated to conform.nvim)
  • Improved nvim-cmp with cmdline completion, Lua API completion, spell checking, and refined completion confirmation behavior
  • Migrated and expanded meowg1k AI configuration with Gemini models and comprehensive task definitions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lua/plugins/nvim-lspconfig.lua Enhanced TypeScript LSP setup with organize imports command, comprehensive inlay hints configuration, and explicit filetype support
lua/plugins/nvim-cmp.lua Added cmdline, nvim-lua, and spell completion sources; refined completion confirmation behavior and source prioritization
lua/plugins/conform.lua Removed prettier/prettierd tab-width configuration (formatting delegated to project configs)
lazy-lock.json Updated plugin versions including new completion sources and dependency updates
.meowg1k/config.yaml Removed old AI tooling configuration file
.meowg1k.yml Added comprehensive AI tooling configuration with Gemini models and detailed task definitions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +236 to +242
vim.api.nvim_create_user_command("LspOrganize", function()
vim.lsp.buf.execute_command({
command = "_typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
title = "",
})
end, { desc = "Organize Imports" })
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LspOrganize command is created every time on_attach is called for each TypeScript buffer, potentially creating duplicate commands. This should be created once globally, or checked for existence before creation to avoid duplication warnings.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Oct 29, 2025

@retran I've opened a new pull request, #31, to work on those changes. Once the pull request is ready, I'll request review from you.

@retran retran merged commit 590e7f5 into dev Oct 29, 2025
6 checks passed
@retran retran deleted the retran/support-typescript branch October 29, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants