Skip to content

Commit

Permalink
feat: demonstrate custom views
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed May 30, 2023
1 parent 25e3bf7 commit d81940c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
41 changes: 41 additions & 0 deletions demo/src/Visual_Studio_Code_1.35_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion demo/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ import 'vscode/default-extensions/json'
import 'vscode/default-extensions/theme-seti'
import 'vscode/default-extensions/references-view'
import * as vscode from 'vscode'
import iconUrl from './Visual_Studio_Code_1.35_icon.svg?url'

registerCustomView({
id: 'custom-view',
name: 'Custom demo view',
renderBody: function (container: HTMLElement): monaco.IDisposable {
container.style.display = 'flex'
container.style.alignItems = 'center'
container.style.justifyContent = 'center'
container.innerHTML = 'This is a custom view<br />You can render anything you want here'

return {
dispose () {
}
}
},
location: ViewContainerLocation.Panel,
icon: new URL(iconUrl, window.location.href).toString()
})

// Workers
interface WorkerConstructor {
Expand Down Expand Up @@ -151,7 +170,8 @@ const debuggerExtension = {
contributes: {
debuggers: [{
type: 'javascript',
label: 'Test'
label: 'Test',
languages: ['javascript']
}],
breakpoints: [{
language: 'javascript'
Expand Down

0 comments on commit d81940c

Please sign in to comment.