Skip to content

Commit

Permalink
chore(doc): add refactor buffer section
Browse files Browse the repository at this point in the history
Related #1080
  • Loading branch information
chemzqm committed Aug 31, 2023
1 parent 0a2c8b8 commit 1d36382
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions doc/coc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,8 @@ Cursors session could be started by following ways:

• Use command `:CocCommand document.renameCurrentWord` to rename variable
under cursor.
• Use |<Plug>(coc-refactor)| to open refactor buffer.
• Use |:CocSearch| to open searched locations.
• Use |<Plug>(coc-refactor)| to open |coc-refactor-buffer|.
• Use |:CocSearch| to open searched locations with |coc-refactor-buffer|.
• Use cursors related key-mappings to add text range, including
|<Plug>(coc-cursors-operator)|, |<Plug>(coc-cursors-word)|,
|<Plug>(coc-cursors-position)| and |<Plug>(coc-cursors-range)|
Expand All @@ -1186,6 +1186,18 @@ Use |coc-config-cursors| to change cursors related key-mappings.
Use highlight group |CocCursorRange| to change default range highlight.
Use |b:coc_cursors_activated| to check if cursors session is activated.

*coc-refactor-buffer*

Refactor buffer is a specific buffer with |coc-cursors| enabled, normally
opened by |CocAction('refactor')| and |:CocSearch|. When the refactor buffer
saved, related buffers and files would be changed at once, workspace edits
would be applied, which could be undo and redo, see |coc-workspace-edits|.

Check out |coc-config-refactor| for related configuration.

Use <CR> to open buffer at current position in split window.
Use <Tab> to invoke tab open or remove action with current code chunk.

--------------------------------------------------------------------------------
SYMBOLS OUTLINE *coc-outline*

Expand Down Expand Up @@ -2603,13 +2615,9 @@ Acceptable {action} names for |CocAction()| and |CocActionAsync()|.

"refactor" *CocAction('refactor')*

Open refactor windows with current symbol as activated cursor ranges.
Check |coc-config-cursors| and |coc-config-refactor| for related
configuration. Use |coc-config-workspace-openResourceCommand| for
command to open buffers on save.

Use <CR> to open buffer at current position in split window.
Use <Tab> to invoke tab open or remove action with current chunk.
Open |coc-refactor-buffer| with current symbol as activated cursor
ranges. Requires LSP rename support enabled with current buffer, use
|:CocSearch| when rename support is not available.

"format" *CocAction('format')*

Expand Down Expand Up @@ -3007,7 +3015,7 @@ COMMANDS *coc-commands*
:CocSearch *:CocSearch*

Perform search by ripgrep https://github.com/BurntSushi/ripgrep,
refactor window would be opened.
and open |coc-refactor-buffer| with searched results.

Note: the search is performed on your files, so normally you should
save your buffers before invoke this command.
Expand Down

0 comments on commit 1d36382

Please sign in to comment.