import * as vscode from 'vscode'; export class TextDocumentContentProvider implements vscode.TextDocumentContentProvider { private _onDidChange = new vscode.EventEmitter(); private _data = null; public provideTextDocumentContent(uri: vscode.Uri): string { if (!this._data) return this.errorSnippet(); let styles = `` let text = `${styles}` text += this._data['columnDefinitions'].map((x) => ``).join('') text += '' text += this._data['rows'].map((r) => '' + r['columns'].map((c) => '').join('') + '' ).join('') text += '
${x['name']}
' + c['value'] + '
' return text; } get onDidChange(): vscode.Event { return this._onDidChange.event; } public update(uri: vscode.Uri) { this._onDidChange.fire(uri); } public setData(data) { this._data = data; } private errorSnippet(): string { return `
ID Name
1 Foobar
`; } }