-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from kaishuu0123/imprv/1-export-preview-as-svg
close #1. support export preview (Save as SVG command)
- Loading branch information
Showing
7 changed files
with
235 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import * as vscode from 'vscode'; | ||
import { join } from "path"; | ||
import {join} from "path"; | ||
|
||
export var outputPanel = vscode.window.createOutputChannel("ERD"); | ||
export var outputPanel = vscode | ||
.window | ||
.createOutputChannel("ERD"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,45 @@ | ||
import * as child_process from "child_process"; | ||
import * as vscode from 'vscode'; | ||
import {writeFileSync} from "fs"; | ||
|
||
// Utility functions. | ||
export function getErdProgram(extensionId): string | ||
{ | ||
const configuration = vscode.workspace.getConfiguration(extensionId); | ||
const erdPath = configuration.get<string>("erdPath"); | ||
export function getErdProgram(extensionId) : string { | ||
const configuration = vscode | ||
.workspace | ||
.getConfiguration(extensionId); | ||
const erdPath = configuration.get < string > ("erdPath"); | ||
|
||
if (erdPath === null || erdPath === undefined) | ||
{ | ||
if (erdPath === null || erdPath === undefined) { | ||
return "erd"; | ||
} | ||
else | ||
{ | ||
} else { | ||
return erdPath; | ||
} | ||
} | ||
|
||
export function getDotProgram(extensionId): string | ||
{ | ||
const configuration = vscode.workspace.getConfiguration(extensionId); | ||
const dotPath = configuration.get<string>("dotPath"); | ||
export function getDotProgram(extensionId) : string { | ||
const configuration = vscode | ||
.workspace | ||
.getConfiguration(extensionId); | ||
const dotPath = configuration.get < string > ("dotPath"); | ||
|
||
if (dotPath === null || dotPath === undefined) | ||
{ | ||
if (dotPath === null || dotPath === undefined) { | ||
return "dot"; | ||
} | ||
else | ||
{ | ||
} else { | ||
return dotPath; | ||
} | ||
} | ||
|
||
export function getSourceUri(previewUri : vscode.Uri) : vscode.Uri { | ||
return vscode | ||
.Uri | ||
.parse(previewUri.query); | ||
} | ||
|
||
export async function getSourceText(uri) { | ||
const sourceUri = getSourceUri(uri); | ||
const sourceDocument = await vscode | ||
.workspace | ||
.openTextDocument(sourceUri); | ||
const sourceText = sourceDocument.getText(); | ||
return sourceText; | ||
} |
Oops, something went wrong.