obsolete;
authorwenzelm
Wed, 26 Feb 2020 15:38:13 +0100
changeset 71480 bb1c829534ba
parent 71479 6aa2dc263912
child 71481 ea6adb18730d
obsolete;
src/Tools/VSCode/extension/src/content_provider.ts
--- a/src/Tools/VSCode/extension/src/content_provider.ts	Wed Feb 26 15:38:04 2020 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-'use strict'
-
-import { Event, EventEmitter, Uri, TextDocumentContentProvider, Disposable,
-  workspace } from 'vscode'
-
-
-export class Content_Provider implements TextDocumentContentProvider
-{
-  private _uri_template: Uri
-  get uri_template(): Uri { return this._uri_template }
-  get uri_scheme(): string { return this.uri_template.scheme }
-
-  constructor(uri_scheme: string)
-  {
-    this._uri_template = Uri.parse("scheme:").with({ scheme: uri_scheme })
-  }
-  dispose() { }
-
-  private emitter = new EventEmitter<Uri>()
-  public update(uri: Uri) { this.emitter.fire(uri) }
-  get onDidChange(): Event<Uri> { return this.emitter.event }
-
-  private content = new Map<string, string>()
-  public set_content(uri: Uri, content: string) { this.content.set(uri.toString(), content)}
-
-  provideTextDocumentContent(uri: Uri): string
-  {
-    return this.content.get(uri.toString()) || ""
-  }
-
-  public register(): Disposable
-  {
-    return workspace.registerTextDocumentContentProvider(this.uri_scheme, this)
-  }
-}