Skip to content

Commit

Permalink
fix(demo): flag extension as web
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Feb 16, 2024
1 parent a82ec3d commit 7d5e590
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion demo/src/features/debugger.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { ExtensionHostKind, registerExtension } from 'vscode/extensions'
import type * as vscode from 'vscode'

const { getApi } = registerExtension({
const { getApi, registerFileUrl } = registerExtension({
name: 'debugger',
publisher: 'codingame',
version: '1.0.0',
engines: {
vscode: '*'
},
// A browser field is mandatory for the extension to be flagged as `web`
browser: 'extension.js',
contributes: {
debuggers: [{
type: 'javascript',
Expand All @@ -20,6 +22,8 @@ const { getApi } = registerExtension({
}
}, ExtensionHostKind.LocalProcess)

registerFileUrl('./extension.js', 'data:text/javascript;base64,' + window.btoa('// nothing'))

void getApi().then(async debuggerVscodeApi => {
class WebsocketDebugAdapter implements vscode.DebugAdapter {
constructor (private websocket: WebSocket) {
Expand Down

0 comments on commit 7d5e590

Please sign in to comment.