57 Commits

Author SHA1 Message Date
a6bf1eaeee Merge branch 'master' of github.com:CarGDev/codetyper.nvim 2026-03-24 23:07:11 -04:00
d9264bff1d Fix CI failures — StyLua parse error and Luacheck warnings
- Replace invalid // comment in window/init.lua with Lua -- comment
- Make check_for_closed_prompt a local function (was leaking global)
- Require get_config for close_tag pattern instead of undefined config
- Wire auto_process through preferences.is_auto_process_enabled()
- Add local extract_functions/classes/imports helpers to auto_index_file
- Remove unused comment_block_start/comment_block_end variables
2026-03-24 23:06:58 -04:00
ddd9ce7de8 Fix CI failures — StyLua parse error and Luacheck warnings
- Replace invalid // comment in window/init.lua with Lua -- comment
- Make check_for_closed_prompt a local function (was leaking global)
- Require get_config for close_tag pattern instead of undefined config
- Wire auto_process through preferences.is_auto_process_enabled()
- Add local extract_functions/classes/imports helpers to auto_index_file
- Remove unused comment_block_start/comment_block_end variables

Made-with: Cursor
v1.0.3
2026-03-24 23:05:27 -04:00
a7d269944d Bump version to 1.0.2 — module refactoring to one-function-per-file
Migrated 10 monolithic modules (parser, cmp, context_modal, diff_review,
logs, logs_panel, thinking, throbber, commands, autocmds) into granular
pure files. Deleted all barrel files and updated consumers to import
directly. Removed unused dead code files.
2026-03-24 23:00:45 -04:00
5c20f57eb4 migrating autocmds 2026-03-24 22:56:38 -04:00
75de3198cd Adding the migration to pure files only 2026-03-24 22:31:49 -04:00
69c8061b8e migrating the logs 2026-03-24 21:57:02 -04:00
9687b352d5 migrating the logs file 2026-03-24 21:53:14 -04:00
4416626acf migrating the diff_review 2026-03-24 21:47:10 -04:00
565e3658b5 refactoring the context 2026-03-24 21:32:03 -04:00
f8ce473877 migrating the cmp brain 2026-03-24 21:18:06 -04:00
0d83c6ba4d Making changes on the parser file to pure functions 2026-03-24 21:02:14 -04:00
d93fed165f Refactor: moving injects and start the parser
- moving all the inject functions inside its proper folder
- starting the parser refactoring
2026-03-23 23:48:25 -04:00
Carlos Gutierrez
5fa7d7d347 Add SECURITY.md for security policy and reporting
Added a security policy document outlining supported versions and vulnerability reporting.
2026-03-18 23:36:20 -04:00
35b808ca1e release: v1.0.1 — CI, formatting, docs, version command
- Add :Coder version command with M.version constant
- Add .stylua.toml (2-space) and .luacheckrc configs
- Rewrite CI: lua.yaml (lint + auto-format + health), release.yaml
- Remove avante.nvim Rust/pre-commit workflows
- Fix 7 files missing local M = {}, cmp newline bug, loop.lua syntax
- Update all docs to match current project state
- Switch codebase from tabs to 2-space indentation

Made-with: Cursor
v1.0.1
2026-03-18 23:31:41 -04:00
3a1472670b feat: adding lua linter 2026-03-18 23:29:02 -04:00
fe118e0885 fixing github actions 2026-03-18 23:20:00 -04:00
e57209a1f8 feat: adding multiple files
### Added

- **Smart Scope Resolution** — Tree-sitter + indentation context for
selections
  - `resolve_selection_context()` in `scope/init.lua` handles partial
functions,
    whole functions, multi-function spans, indent blocks, and whole-file
selections
  - Enclosing function automatically sent as context when selecting code
inside one
  - Whole-file selection (>=80% of lines) triggers project tree as
context
  - Indentation-based fallback when Tree-sitter is unavailable

- **Explain-to-Document Intent** — "explain" prompts generate
documentation
  - Detects prompts like "explain this", "tell me about", "what does",
"question"
  - Generates documentation comments and inserts them above selected
code
  - Shows notification if nothing is selected
  - Updated intent action from "none" to "insert" for explain intent

- **Granular LLM Status Notifications** — Real-time progress reporting
  - Inline virtual text and floating status window show current stage
  - Stages: "Reading context...", "Searching index...", "Gathering
context...",
    "Recalling patterns...", "Building prompt...", "Sending to
[provider]...",
    "Processing response...", "Generating patch...", "Applying code..."
  - `update_inline_status()` in `thinking_placeholder.lua`
  - `update_stage()` in `thinking.lua`

- **Thinking Placeholder Positioning** — "Implementing..." appears above
selection
  - Uses `virt_lines_above = true` on extmark at selection start line
  - Dynamic status text updates during LLM processing

### Changed

- **Providers reduced to Copilot and Ollama only**
  - Removed Claude, OpenAI, and Gemini provider integrations
  - Deleted `llm/openai.lua` and `llm/gemini.lua`
  - Cleaned `llm/init.lua`, `config/defaults.lua`, `types.lua`,
`credentials.lua`,
    `cost/init.lua`, and `events/queue.lua` of all references
  - `valid_providers` now only includes "copilot" and "ollama"

- **Removed timer-based delayed processing** — Prompts are processed
instantly
  - Removed `timer` field, `timeout_ms`, and timer setup/cancellation
from `worker.lua`

- **Removed chat/agent/split window UI**
  - Deleted `ui/chat.lua`, `windows.lua`, `ui/switcher.lua`
  - Removed `CoderOpen`, `CoderClose`, `CoderToggle` commands
  - Removed window management from `autocmds.lua`, `inject.lua`,
`executor.lua`
  - Removed auto-open companion file logic

- **Commands removed from menu** (code retained with TODOs for
re-enabling)
  - `CoderAddApiKey`, `CoderRemoveApiKey`, `CoderBrain`,
`CoderFeedback`,
    `CoderMemories`, `CoderForget`, `CoderProcess`
  - Subcommands `process`, `status`, `memories`, `forget`,
`llm-feedback-good`,
    `llm-feedback-bad`, `add-api-key`, `remove-api-key` removed from
completion

### Fixed

- Fixed `patch.lua` syntax error — missing `if` wrapper around
SEARCH/REPLACE block
- Fixed `CoderModel` require path typo
(`codetyper.adapters.config.credentials`
  → `codetyper.config.credentials`)
- Fixed `thinking_placeholder` extmark placement appearing after
selection
  instead of above it
v1.0.0
2026-03-18 23:05:26 -04:00
f110a3ed25 Modifying the doc files 2026-03-18 22:02:10 -04:00
9f229b26c9 Fixing the old configuration 2026-03-18 21:56:45 -04:00
f6266c7d94 Fixing the issue on the selection 2026-03-14 12:52:06 -04:00
4671e479df docs: add transform-selection documentation
- Add usage guide for <leader>ctt in Normal and Visual mode
- Document insert at cursor vs replace selection behavior
- Add queue waiting notification explanation
- Update commands reference
2026-02-17 00:18:18 -05:00
0a1429a823 Adding the functionallity and refactoring 2026-02-17 00:15:40 -05:00
4463a8144d Patch/inject: plain-code inline, inject() API, range capture, logger
- Inline prompts: use plain 'replace selection' prompt instead of SEARCH/REPLACE
- Add codetyper.inject.inject(bufnr, code, opts) for patch apply (replace/insert/append)
- Patch: on SEARCH/REPLACE failure use REPLACE parts only; inline always replace range
- Fix 0-0 range: clamp in create_from_event, prefer scope_range when invalid
- Commands: capture injection range from selection (derive end from line count); no selection = whole file
- Commands: log injection range; pass injection_range in prompt; autocmds prefer it
- Replace diagnostic logs with codetyper.support.logger in patch and scheduler
- Fix patch apply syntax (code_to_inject variable for multi-line logger call)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-16 18:06:21 -05:00
e534d607d8 fixing unable files 2026-02-16 11:12:22 -05:00
4bef7e2d55 Deleting unnecesary features 2026-02-16 10:38:09 -05:00
258b29f5f0 Fix: correct import path for preferences module v0.6.0 2026-01-16 12:04:09 -05:00
6a69a524ea Refactor: standardize 'agent' -> 'agents' for params and prompts 2026-01-16 12:01:42 -05:00
10c1de8843 Refactor: Restructure project into core, features, adapters, and config modules 2026-01-16 11:52:46 -05:00
4fb52596e3 Refactoring code 2026-01-16 11:33:11 -05:00
9dfb52ac8d Refactoring code 2026-01-16 10:45:34 -05:00
c9be0cf804 Fixing build 2026-01-16 09:44:17 -05:00
60577f8951 feat: add conflict resolution, linter validation, and SEARCH/REPLACE system
- Add git-style conflict resolution with visual diff highlighting
- Add buffer-local keymaps: co/ct/cb/cn for conflict resolution
- Add floating menu with auto-show after code injection
- Add linter validation that auto-checks LSP diagnostics after accepting code
- Add SEARCH/REPLACE block parsing with fuzzy matching
- Add new commands: CoderConflictMenu, CoderLintCheck, CoderLintFix
- Update README with complete keymaps reference and issue reporting guide
- Update CHANGELOG and llms.txt with full documentation
- Clean up code comments and documentation

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 09:00:35 -05:00
f5df1a9ac0 Adding more features v0.5.0 2026-01-15 20:58:56 -05:00
84c8bcf92c Adding autocomplete and copilot suggestions 2026-01-14 21:43:56 -05:00
5493a5ec38 test: add unit tests for preferences module
- Test default values and loading preferences
- Test saving and persistence to .coder/preferences.json
- Test get/set individual preference values
- Test is_auto_process_enabled and has_asked_auto_process
- Test toggle_auto_process behavior
- Test cache management (clear_cache)
- Handle invalid JSON gracefully

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
v0.4.0
2026-01-13 23:53:21 -05:00
c3da2901c9 feat: add user preference system for auto/manual tag processing
- Add preferences.lua module for managing per-project preferences
  - Stores preferences in .coder/preferences.json
  - Shows floating dialog to ask user on first /@ @/ tag
  - Supports toggle between auto/manual modes

- Update autocmds.lua with preference-aware wrapper functions
  - check_for_closed_prompt_with_preference()
  - check_all_prompts_with_preference()
  - Only auto-process when user chose automatic mode

- Add CoderAutoToggle and CoderAutoSet commands
  - Toggle between automatic and manual modes
  - Set mode directly with :CoderAutoSet auto|manual

- Fix completion.lua to work in directories outside project
  - Use current file's directory as base when editing files
    outside cwd (e.g., ~/.config/* files)
  - Search in both current dir and cwd for completions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:51:17 -05:00
46672f6f87 feat: add function completion, apply delay, and VimLeavePre cleanup
Major improvements to the event-driven prompt processing system:

Function Completion:
- Override intent to "complete" when prompt is inside function/method scope
- Use Tree-sitter to detect enclosing scope and replace entire function
- Special LLM prompt instructs to complete function body without duplicating
- Patch apply uses "replace" strategy for scope range instead of appending

Apply Delay:
- Add `apply_delay_ms` config option (default 5000ms) for code review time
- Log "Code ready. Applying in X seconds..." before applying patches
- Configurable wait time before removing tags and injecting code

VimLeavePre Cleanup:
- Logs panel and queue windows close automatically on Neovim exit
- Context modal closes on VimLeavePre
- Scheduler stops timer and cleans up augroup on exit
- Handle QuitPre for :qa, :wqa commands
- Force close with buffer deletion for robust cleanup

Response Cleaning:
- Remove LLM special tokens (deepseek, llama markers)
- Add blank line spacing before appended code
- Log full raw LLM response in logs panel for debugging

Documentation:
- Add required dependencies (plenary.nvim, nvim-treesitter)
- Add optional dependencies (nvim-treesitter-textobjects, nui.nvim)
- Document all intent types including "complete"
- Add Logs Panel section with features and keymaps
- Update lazy.nvim example with dependencies

Tests:
- Add tests for patch create_from_event with different strategies
- Fix assert.is_true to assert.is_truthy for string.match

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:40:13 -05:00
0600144768 fixing the issues on the tags 2026-01-13 23:16:27 -05:00
fbd88993e7 Adding test cases v0.3.0 2026-01-13 22:18:32 -05:00
6b25aef917 fixing configuration to change the windows 2026-01-13 22:07:02 -05:00
8a3ee81c3f feat: add event-driven architecture with scope resolution
- Add event queue system (queue.lua) with priority-based processing
- Add patch system (patch.lua) with staleness detection via changedtick
- Add confidence scoring (confidence.lua) with 5 weighted heuristics
- Add async worker wrapper (worker.lua) with timeout handling
- Add scheduler (scheduler.lua) with completion-aware injection
- Add Tree-sitter scope resolution (scope.lua) for functions/methods/classes
- Add intent detection (intent.lua) for complete/refactor/fix/add/etc
- Add tag precedence rules (first tag in scope wins)
- Update autocmds to emit events instead of direct processing
- Add scheduler config options (ollama_scout, escalation_threshold)
- Update prompts with scope-aware context
- Update README with emojis and new features
- Update documentation (llms.txt, CHANGELOG.md, doc/codetyper.txt)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 21:55:44 -05:00
6268a57498 adding claude.lua 2026-01-13 21:02:45 -05:00
6b71c76517 style: normalize indentation in claude.lua
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:57:03 -05:00
73c56d2f6d feat: add real-time logs panel for /@ @/ code generation
- Add logs_panel.lua module for standalone logs display
- Add logging to generate() functions in claude.lua and ollama.lua
- Show logs panel automatically when running transform commands
- Log request/response with token counting for both providers
- Add :CoderLogs command to toggle logs panel manually
- Clean up duplicate generate_with_tools function in claude.lua

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:54:26 -05:00
2989fb5f14 feat: add agent mode and CoderType command for mode switching
- Add agent module with tool execution support (read_file, edit_file, bash)
- Add agent/ui.lua with chat sidebar, input area, and real-time logs panel
- Add agent/logs.lua for token counting and request/response logging
- Add generate_with_tools to claude.lua and ollama.lua for tool use
- Add chat_switcher.lua modal picker for Ask/Agent mode selection
- Add CoderType command to show mode switcher (replaces C-Tab keymaps)
- Update ask.lua and agent/ui.lua headers to reference :CoderType

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:45:55 -05:00
9c99944f26 updating files v0.2.0 2026-01-11 20:12:13 -05:00
29f321995d fix: improve code prompts to output only raw code
Add explicit instruction to all code generation prompts to return
only raw code without explanations, markdown, or code fences.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 19:48:17 -05:00
9d52b9364f updating files 2026-01-11 17:58:56 -05:00
86504eec55 updating files 2026-01-11 17:38:25 -05:00