openTextDocument

Open a document file through the specified uri or file path.

Parameter

Name Type Description
uri String or Uri File Path or identifies the resource to open.

Returns

Type Description
Promise<TextDocument> A promise that resolves to a document.

Example

  1. var documentPromise = hx.workspace.openTextDocument("foo/bar.js");
  2. documentPromise.then(function(document) {
  3. console.log("Document opened:",document.fileName);
  4. });