Hotkey for creating definition(templating definitions)? #3192
-
Hello, I was wondering if there was a feature to CoC that allows for the creation of a definition for types/methods/etc if they are written before their definitions are. Chess Example [C]: struct Board
{
Piece board[8][8];
} You would have this typed out, and CoC would recognize that you have not yet created they type "Piece". I was wondering if there was any hotkeys that I was not aware of that you could press in order for CoC to "smartly" create a template for that type. that is, in this example, you would hit some hotkey such as "< Leader > cd" with the cursor on the undefined type (cd would stand for create definition), and it would create somewhere in the code (probably at the bottom as a default I think?). Then the following template would be generated: struct Board
{
Piece board[8][8];
}
struct Piece
{
} and in this instance it would place the cursor inside of the Piece struct for easy to start the definition for it. This obviously would be a bit overkill, because where you want to place this in code is stylistic and so automating this templating would not necessarily be useful. I was just curious if there is something to this effect that I was not aware of. I wouldn't expect it in the slightest, and it doesn't really do much since a lot of the time you would need to move the whole template that is created to a spot in the code that makes sense. Thanks you, Daniel |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No, send your feature request to LSP https://microsoft.github.io/language-server-protocol/specifications/specification-current/, or write a coc.nvim extension. |
Beta Was this translation helpful? Give feedback.
No, send your feature request to LSP https://microsoft.github.io/language-server-protocol/specifications/specification-current/, or write a coc.nvim extension.