coc-git 2.7.8 → 2.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +24 -0
- package/assets/coc-git-logo.png +0 -0
- package/history.md +7 -0
- package/lib/index.js +1654 -1317
- package/package.json +45 -1
- package/AGENTS.md +0 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coc-git",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.9",
|
|
4
4
|
"description": "Git extension for coc.nvim",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"publisher": "chemzqm",
|
|
@@ -264,12 +264,24 @@
|
|
|
264
264
|
"scope": "window",
|
|
265
265
|
"description": "Update gutters in realtime, default: true."
|
|
266
266
|
},
|
|
267
|
+
"git.enableStagedGutters": {
|
|
268
|
+
"type": "boolean",
|
|
269
|
+
"default": false,
|
|
270
|
+
"scope": "window",
|
|
271
|
+
"description": "Show staged changes in the sign column."
|
|
272
|
+
},
|
|
267
273
|
"git.signPriority": {
|
|
268
274
|
"type": "number",
|
|
269
275
|
"default": 10,
|
|
270
276
|
"scope": "application",
|
|
271
277
|
"description": "Priority of sign gutters, default to 10."
|
|
272
278
|
},
|
|
279
|
+
"git.stagedSignPriority": {
|
|
280
|
+
"type": "number",
|
|
281
|
+
"default": 9,
|
|
282
|
+
"scope": "window",
|
|
283
|
+
"description": "Priority of staged gutter signs."
|
|
284
|
+
},
|
|
273
285
|
"git.pushArguments": {
|
|
274
286
|
"type": "array",
|
|
275
287
|
"default": [],
|
|
@@ -339,6 +351,38 @@
|
|
|
339
351
|
"scope": "application",
|
|
340
352
|
"description": "Highlight group for change removed sign."
|
|
341
353
|
},
|
|
354
|
+
"git.stagedAddedSign.text": {
|
|
355
|
+
"type": "string",
|
|
356
|
+
"default": "┃"
|
|
357
|
+
},
|
|
358
|
+
"git.stagedAddedSign.hlGroup": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"default": "CocGitStagedAdd"
|
|
361
|
+
},
|
|
362
|
+
"git.stagedChangedSign.text": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"default": "┃"
|
|
365
|
+
},
|
|
366
|
+
"git.stagedChangedSign.hlGroup": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"default": "CocGitStagedChange"
|
|
369
|
+
},
|
|
370
|
+
"git.stagedRemovedSign.text": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"default": "╻"
|
|
373
|
+
},
|
|
374
|
+
"git.stagedRemovedSign.hlGroup": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"default": "CocGitStagedDelete"
|
|
377
|
+
},
|
|
378
|
+
"git.mixedSign.text": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"default": "┋"
|
|
381
|
+
},
|
|
382
|
+
"git.mixedSign.hlGroup": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"default": "CocGitMixed"
|
|
385
|
+
},
|
|
342
386
|
"git.semanticCommit.filetypes": {
|
|
343
387
|
"type": [
|
|
344
388
|
"array",
|
package/AGENTS.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# AGENTS.md
|
|
2
|
-
|
|
3
|
-
## Repository purpose
|
|
4
|
-
|
|
5
|
-
`coc-git` is the Git integration extension for `coc.nvim`. Its runtime entry point is `src/index.ts`; the published entry point is the bundled `lib/index.js`. The extension owns Git-backed buffer state, gutters and blame text, conflict actions, Coc lists, GitHub/GitLab issue completion, and the commands/keymaps declared in `package.json`.
|
|
6
|
-
|
|
7
|
-
## Code map
|
|
8
|
-
|
|
9
|
-
- `src/index.ts` is the activation and registration layer. Register new Coc commands, `<Plug>` keymaps, lists, completion providers, and disposables here.
|
|
10
|
-
- `src/manager.ts` coordinates editor events, live `GitBuffer` instances, configuration, and user-facing operations.
|
|
11
|
-
- `src/model/git.ts` is the low-level child-process wrapper around the configured Git executable.
|
|
12
|
-
- `src/model/repo.ts` implements repository-scoped Git operations; put Git command construction and output parsing there rather than in the activation layer.
|
|
13
|
-
- `src/model/resolver.ts` resolves documents and working directories to repositories and relative paths.
|
|
14
|
-
- `src/model/buffer.ts` owns per-buffer diffs, signs, blame, folds, and conflict state.
|
|
15
|
-
- `src/model/service.ts` owns resolver/repository lifetimes and constructs `GitBuffer` instances.
|
|
16
|
-
- `src/lists/` contains Coc list implementations (`gstatus`, `gfiles`, `gchanges`, `gchunks`, `branches`, `commits`, and `bcommits`). List-specific actions and rendering belong in the corresponding list class.
|
|
17
|
-
- `src/source.ts` implements GitHub/GitLab issue loading plus the `issues` list/completion source.
|
|
18
|
-
- `src/types.ts` is the shared contract for diffs, conflicts, and the configuration object passed into buffer/model code.
|
|
19
|
-
- `package.json` is also the Coc extension manifest: command names, activation, and all user-visible configuration schemas live there.
|
|
20
|
-
- `Readme.md` documents the public commands, keymaps, lists, environment variables, and settings.
|
|
21
|
-
|
|
22
|
-
## Public-contract synchronization
|
|
23
|
-
|
|
24
|
-
When changing a user-facing feature, update every surface that represents the same contract:
|
|
25
|
-
|
|
26
|
-
- A new `git.*` command needs a `commands.registerCommand` registration in `src/index.ts` and an entry under `contributes.commands` in `package.json`. Add it to `Readme.md` when it is intended for direct use.
|
|
27
|
-
- A new `<Plug>(coc-git-...)` mapping needs a `workspace.registerKeymap` registration in `src/index.ts` and matching usage documentation in `Readme.md`.
|
|
28
|
-
- A new `git.*` setting needs a schema entry under `contributes.configuration.properties` in `package.json`, a typed field in `src/types.ts` when consumed beyond the registration layer, and loading/default logic in `DocumentManager.loadConfiguration()` in `src/manager.ts`. Keep defaults identical across those locations and `Readme.md`.
|
|
29
|
-
- A new list must be implemented under `src/lists/`, registered through `listManager` in `src/index.ts`, and added to the documented list names.
|
|
30
|
-
- Preserve the exported `ExtensionApi` shape in `src/index.ts` unless the API change is intentional; other Coc extensions can consume `git`, `resolver`, and `manager` from activation.
|
|
31
|
-
|
|
32
|
-
## Git and editor behavior
|
|
33
|
-
|
|
34
|
-
- Use the configured executable discovered from `git.command`; do not hard-code an executable path. Model-layer Git execution should flow through `Git`, `GitRepo`, or the existing command helpers.
|
|
35
|
-
- Keep Git work asynchronous. Do not introduce synchronous child-process calls into buffer refresh, cursor movement, completion, or list loading paths.
|
|
36
|
-
- Pass arguments as arrays to `Git.exec`, `Git.stream`, or `spawnCommand` when filenames or revisions are involved. The repository already supports paths containing spaces; avoid building an unescaped shell string unless the operation specifically requires an interactive terminal command.
|
|
37
|
-
- Preserve cancellation and disposal behavior around spawned processes and Coc event listeners. Anything registered during activation or manager construction must be owned by the existing `subscriptions`/`disposables` lifecycle.
|
|
38
|
-
- Buffer refreshes are event-driven (`TextChange`, writes when realtime gutters are disabled, `FocusGained`, and `BufEnter`). Changes to diff or blame behavior must account for stale async results and for buffers disposed while repository resolution is still running.
|
|
39
|
-
- Keep Vim and Neovim compatibility. Virtual text, floating windows, namespaces, terminal operations, and popup behavior must retain the existing capability checks or Coc abstractions; do not use a Neovim-only API on an unconditional path.
|
|
40
|
-
- Git output is normalized under `LC_ALL`/`LANG=en_US.UTF-8` and decoded through `iconv-lite`. Parsing code must not depend on the user's localized Git messages.
|
|
41
|
-
- GitHub issue access uses `GITHUB_API_TOKEN`; GitLab access uses `GITLAB_PRIVATE_TOKEN` and `git.gitlab.hosts`. Do not log tokens or put them into rendered list/completion items.
|
|
42
|
-
|
|
43
|
-
## Generated output and dependencies
|
|
44
|
-
|
|
45
|
-
- Do not edit or commit `lib/index.js`; `lib/` is generated and ignored. Change TypeScript under `src/` and rebuild it with `npm run build`.
|
|
46
|
-
- `esbuild.js` must continue to bundle `src/index.ts` for Node while leaving `coc.nvim` external. The bundle target is `node10.12`; avoid emitting runtime syntax or APIs that violate that target unless the target is deliberately raised.
|
|
47
|
-
- Use npm for dependency and lockfile changes. CI installs with `npm ci`, so `package.json` and `package-lock.json` must stay synchronized.
|
|
48
|
-
- `npm run lint` is TypeScript checking (`tsc -p tsconfig.json`), not an ESLint formatting pass. The project enables `noUnusedLocals` and emits nothing during this check.
|
|
49
|
-
|
|
50
|
-
## Verification
|
|
51
|
-
|
|
52
|
-
Run checks according to the affected subsystem:
|
|
53
|
-
|
|
54
|
-
- Type/config/registration changes: `npm run lint` and `npm run build`.
|
|
55
|
-
- Git parsing, repository, buffer, manager, list, source, command, or keymap behavior: `npm test`.
|
|
56
|
-
- Vim-specific behavior: `npm run test:integration:vim`.
|
|
57
|
-
- Neovim-specific behavior: `npm run test:integration:nvim`.
|
|
58
|
-
- Changes intended to pass CI must succeed in both editor variants. The GitHub Actions matrix uses Node 22 and runs typechecking plus the Vim and Neovim integration suites.
|
|
59
|
-
|
|
60
|
-
For manual editor verification, load the rebuilt extension through Coc and exercise the exact public surface changed: the relevant `:CocCommand git.*`, `<Plug>(coc-git-*)` mapping, `:CocList` list, gutter/blame update, conflict action, or issue completion flow. Use a temporary Git repository containing the required staged, unstaged, untracked, renamed, conflicted, or non-UTF-8-path state rather than testing against this checkout's working tree.
|