You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a simple component that can render code snippets in a webview with syntax highlighting, themes, and settings considered.
They could be read-only initially, but perhaps making the editable could make sense.
I think in general, we strongly prefer creating editors or using VS Code's builtin APIs for showing code (peek view, etc).
However, there are several use cases, such as a conversational language model describing some code mixed with text, where having a small code snippet rendered would be nice.
Perhaps the implementation could be from wrapping around a Monaco editor in a web-component (example) that takes VS Code variables or some wrapping around settings, I did not invest much time thinking on the implementation, but I could after hearing your thoughts.
Expected behavior
We could be able to render small snippet with all the settings and themes coming from VS Code.
I imagine something like this.
<vscode-snippetlanguage="typescript">
function foo(bar: string) {
return 'fuzzy wuzzy was a bear';
}
<vscode-snippet>
Current behavior
Currently, it's not possible, we have a few options:
Highlighting them manually based on some pre-defined semantic coloring and use a code mirror editor (similar to what chrome devtools does).
Show a standalone Monaco editor similar to this example. The issue with this one is that, themes are not loaded by default, and user settings are not respected (font-size, indentation, etc).
Use case
We have several use cases:
Rendering snippets coming from ML extensions / LLMs.
Rendering snippets of search results from our custom code search extension.
Rendering inline code for our bug tracking extension.
Feature request
Provide a simple component that can render code snippets in a webview with syntax highlighting, themes, and settings considered.
They could be read-only initially, but perhaps making the editable could make sense.
I think in general, we strongly prefer creating editors or using VS Code's builtin APIs for showing code (peek view, etc).
However, there are several use cases, such as a conversational language model describing some code mixed with text, where having a small code snippet rendered would be nice.
Perhaps the implementation could be from wrapping around a Monaco editor in a web-component (example) that takes VS Code variables or some wrapping around settings, I did not invest much time thinking on the implementation, but I could after hearing your thoughts.
Expected behavior
We could be able to render small snippet with all the settings and themes coming from VS Code.
I imagine something like this.
Current behavior
Currently, it's not possible, we have a few options:
Use case
We have several use cases:
Screenshots/references
This is similar to #315.
The text was updated successfully, but these errors were encountered: