Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ddd9ce7de8 | |||
| a7d269944d |
37
CHANGELOG.md
37
CHANGELOG.md
@@ -7,6 +7,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.0.3] - 2025-03-25
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed `window/init.lua` containing invalid `//` comment syntax causing StyLua parse failure
|
||||
- Fixed `check_for_closed_prompt.lua` declaring a global instead of local function
|
||||
- Fixed `check_for_closed_prompt.lua` accessing undefined `config` variable — now properly requires `get_config`
|
||||
- Fixed `check_for_closed_prompt_with_preference.lua` and `check_all_prompts_with_preference.lua` accessing undefined `auto_process` — now uses `preferences.is_auto_process_enabled()`
|
||||
- Fixed `auto_index_file.lua` calling undefined `extract_functions`, `extract_classes`, `extract_imports` — added local implementations
|
||||
- Removed unused `comment_block_start` and `comment_block_end` variables in `auto_index_file.lua`
|
||||
|
||||
## [1.0.2] - 2025-03-24
|
||||
|
||||
### Changed
|
||||
|
||||
- **Major module refactoring** — Migrated monolithic files to one-function-per-file architecture
|
||||
- `parser.lua` — Extracted 11 functions into `parser/` folder; deleted barrel file and 3 unused files (`get_prompt_at_cursor`, `detect_prompt_type`, `has_unclosed_prompts`)
|
||||
- `cmp/init.lua` — Extracted completion getters into individual files; moved shared source methods to `utils/cmp_source.lua`
|
||||
- `context_modal.lua` — Migrated handlers, utils, and state into `context_modal/` folder; deleted barrel file
|
||||
- `diff_review.lua` — Moved diff entry state functions to `utils/get_config.lua`; extracted remaining functions into `diff_review/` folder; deleted barrel file
|
||||
- `logs.lua` — Extracted 26 log functions into `logs/` folder plus 2 utility files (`get_timestamp`, `estimate_tokens`); deleted barrel file
|
||||
- `logs_panel.lua` — Extracted 10 panel functions into `logs_panel/` folder; deleted barrel file
|
||||
- `thinking.lua` — Extracted 10 functions into `thinking/` folder; deleted barrel file
|
||||
- `throbber.lua` — Extracted class, constructor, and methods into `throbber/` folder; deleted barrel file
|
||||
- `commands.lua` — Extracted 14 command functions into `commands/` folder; deleted barrel file
|
||||
- `autocmds.lua` — Extracted 22 functions, 4 data files, and state into `autocmds/` folder; deleted barrel file and 2 unused files (`clear`, `clear_auto_indexed`)
|
||||
- All external consumers updated to import functions directly from pure files
|
||||
- Renamed single-character and ambiguous variables to descriptive names across all refactored files
|
||||
|
||||
### Added
|
||||
|
||||
- `SECURITY.md` — Security policy and vulnerability reporting guidelines
|
||||
|
||||
## [1.0.1] - 2026-03-19
|
||||
|
||||
### Added
|
||||
@@ -261,7 +294,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- **Fixed** — Bug fixes
|
||||
- **Security** — Vulnerability fixes
|
||||
|
||||
[Unreleased]: https://github.com/cargdev/codetyper.nvim/compare/v1.0.1...HEAD
|
||||
[Unreleased]: https://github.com/cargdev/codetyper.nvim/compare/v1.0.3...HEAD
|
||||
[1.0.3]: https://github.com/cargdev/codetyper.nvim/compare/v1.0.2...v1.0.3
|
||||
[1.0.2]: https://github.com/cargdev/codetyper.nvim/compare/v1.0.1...v1.0.2
|
||||
[1.0.1]: https://github.com/cargdev/codetyper.nvim/compare/v1.0.0...v1.0.1
|
||||
[1.0.0]: https://github.com/cargdev/codetyper.nvim/compare/v0.6.0...v1.0.0
|
||||
[0.6.0]: https://github.com/cargdev/codetyper.nvim/compare/v0.5.0...v0.6.0
|
||||
|
||||
@@ -3,6 +3,50 @@ local autocmds_state = require("codetyper.adapters.nvim.autocmds.state")
|
||||
local is_supported_extension = require("codetyper.adapters.nvim.autocmds.is_supported_extension")
|
||||
local should_ignore_for_coder = require("codetyper.adapters.nvim.autocmds.should_ignore_for_coder")
|
||||
|
||||
local function extract_functions(content, _ext)
|
||||
local results = {}
|
||||
for line in content:gmatch("[^\n]+") do
|
||||
local name = line:match("^%s*function%s+([%w_:%.]+)%s*%(")
|
||||
or line:match("^%s*local%s+function%s+([%w_]+)%s*%(")
|
||||
or line:match("^%s*def%s+([%w_]+)%s*%(")
|
||||
or line:match("^%s*func%s+([%w_]+)%s*%(")
|
||||
or line:match("^%s*async%s+function%s+([%w_]+)%s*%(")
|
||||
or line:match("^%s*public%s+.*%s+([%w_]+)%s*%(")
|
||||
or line:match("^%s*private%s+.*%s+([%w_]+)%s*%(")
|
||||
if name then
|
||||
table.insert(results, { name = name })
|
||||
end
|
||||
end
|
||||
return results
|
||||
end
|
||||
|
||||
local function extract_classes(content, _ext)
|
||||
local results = {}
|
||||
for line in content:gmatch("[^\n]+") do
|
||||
local name = line:match("^%s*class%s+([%w_]+)")
|
||||
or line:match("^%s*public%s+class%s+([%w_]+)")
|
||||
or line:match("^%s*interface%s+([%w_]+)")
|
||||
or line:match("^%s*struct%s+([%w_]+)")
|
||||
if name then
|
||||
table.insert(results, { name = name })
|
||||
end
|
||||
end
|
||||
return results
|
||||
end
|
||||
|
||||
local function extract_imports(content, _ext)
|
||||
local results = {}
|
||||
for line in content:gmatch("[^\n]+") do
|
||||
local imp = line:match("import%s+.*%s+from%s+[\"']([^\"']+)[\"']")
|
||||
or line:match("require%([\"']([^\"']+)[\"']%)")
|
||||
or line:match("from%s+([%w_.]+)%s+import")
|
||||
if imp then
|
||||
table.insert(results, imp)
|
||||
end
|
||||
end
|
||||
return results
|
||||
end
|
||||
|
||||
--- Auto-index a file by creating/opening its coder companion
|
||||
---@param bufnr number Buffer number
|
||||
local function auto_index_file(bufnr)
|
||||
@@ -54,8 +98,6 @@ local function auto_index_file(bufnr)
|
||||
local file_ext = vim.fn.fnamemodify(filepath, ":e")
|
||||
|
||||
local comment_prefix = "--"
|
||||
local comment_block_start = "--[["
|
||||
local comment_block_end = "]]"
|
||||
if
|
||||
file_ext == "ts"
|
||||
or file_ext == "tsx"
|
||||
@@ -69,12 +111,8 @@ local function auto_index_file(bufnr)
|
||||
or file_ext == "rs"
|
||||
then
|
||||
comment_prefix = "//"
|
||||
comment_block_start = "/*"
|
||||
comment_block_end = "*/"
|
||||
elseif file_ext == "py" or file_ext == "rb" or file_ext == "yaml" or file_ext == "yml" then
|
||||
comment_prefix = "#"
|
||||
comment_block_start = '"""'
|
||||
comment_block_end = '"""'
|
||||
end
|
||||
|
||||
local content = ""
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
local processed_prompts = require("codetyper.constants.constants").processed_prompts
|
||||
local get_prompt_key = require("codetyper.adapters.nvim.autocmds.get_prompt_key")
|
||||
local check_all_prompts = require("codetyper.adapters.nvim.autocmds.check_all_prompts")
|
||||
local preferences = require("codetyper.config.preferences")
|
||||
|
||||
--- Check all prompts with preference check
|
||||
--- Only processes if there are unprocessed prompts and auto_process is enabled
|
||||
local function check_all_prompts_with_preference()
|
||||
local preferences = require("codetyper.config.preferences")
|
||||
local find_prompts_in_buffer = require("codetyper.parser.find_prompts_in_buffer")
|
||||
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
@@ -27,7 +27,7 @@ local function check_all_prompts_with_preference()
|
||||
return
|
||||
end
|
||||
|
||||
if auto_process then
|
||||
if preferences.is_auto_process_enabled() then
|
||||
check_all_prompts()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,9 +4,10 @@ local is_processing = require("codetyper.constants.constants").is_processing
|
||||
local get_prompt_key = require("codetyper.adapters.nvim.autocmds.get_prompt_key")
|
||||
local read_attached_files = require("codetyper.adapters.nvim.autocmds.read_attached_files")
|
||||
local create_injection_marks = require("codetyper.adapters.nvim.autocmds.create_injection_marks")
|
||||
local get_config = require("codetyper.utils.get_config").get_config
|
||||
|
||||
--- Check if the buffer has a newly closed prompt and auto-process
|
||||
function check_for_closed_prompt()
|
||||
local function check_for_closed_prompt()
|
||||
if is_processing then
|
||||
return
|
||||
end
|
||||
@@ -36,7 +37,8 @@ function check_for_closed_prompt()
|
||||
|
||||
local current_line = lines[1]
|
||||
|
||||
if has_closing_tag(current_line, config.patterns.close_tag) then
|
||||
local cfg = get_config()
|
||||
if has_closing_tag(current_line, cfg.patterns.close_tag) then
|
||||
local prompt = get_last_prompt(bufnr)
|
||||
if prompt and prompt.content and prompt.content ~= "" then
|
||||
local prompt_key = get_prompt_key(bufnr, prompt)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
local check_for_closed_prompt = require("codetyper.adapters.nvim.autocmds.check_for_closed_prompt")
|
||||
local preferences = require("codetyper.config.preferences")
|
||||
|
||||
--- Check for closed prompt with preference check
|
||||
--- If auto_process is enabled, process; otherwise do nothing (manual mode)
|
||||
@@ -11,7 +12,7 @@ local function check_for_closed_prompt_with_preference()
|
||||
return
|
||||
end
|
||||
|
||||
if auto_process then
|
||||
if preferences.is_auto_process_enabled() then
|
||||
check_for_closed_prompt()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
local M = {}
|
||||
|
||||
M.version = "1.0.1"
|
||||
M.version = "1.0.3"
|
||||
|
||||
---@type CoderConfig
|
||||
M.config = {}
|
||||
|
||||
@@ -1 +1 @@
|
||||
// TODO: Migrate the prompt window here to centralized the logic
|
||||
-- TODO: Migrate the prompt window here to centralize the logic
|
||||
|
||||
Reference in New Issue
Block a user