-
Hi all, Can someone explain what the 'key' attribute of Vscode.TextEditorDecorationType.create is? I would appreciate a lot if an example for using 'key' is provided as well. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can reference the official VS Code API documentation: https://code.visualstudio.com/api/references/vscode-api The documentation for TextEditorDecorationType says that
That means you don't have to set the If it's helpful, I found a TypeScript example of using decorators here: https://github.com/microsoft/vscode-extension-samples/blob/main/decorator-sample/USAGE.md |
Beta Was this translation helpful? Give feedback.
-
Thanks, it helped a lot. :) |
Beta Was this translation helpful? Give feedback.
You can reference the official VS Code API documentation: https://code.visualstudio.com/api/references/vscode-api
The documentation for TextEditorDecorationType says that
key
is the "Internal representation of the handle."More importantly, it says the following:
That means you don't have to set the
key
value yourself. However, since we don't have bindings for thecreateTextEditorDecorationType
function yet, that means you will have to add the binding yourself (inside theWindow
module). That function has a parameter of type DecorationRenderOptions that also needs bindings.If it's helpful, I found a Ty…