diff options
author | Aleksey Kladov <[email protected]> | 2018-08-27 18:58:38 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-27 18:58:38 +0100 |
commit | aaca7d003bd969785be53d8f312b67bfa26f6272 (patch) | |
tree | 9e3ab4d75d631fb1055fb6ab5c05f0a78153fadd /code | |
parent | 846114a6e95da696deb6a0f3243ad23c45074a00 (diff) |
move scopes to file
Diffstat (limited to 'code')
-rw-r--r-- | code/package.json | 4 | ||||
-rw-r--r-- | code/src/extension.ts | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/code/package.json b/code/package.json index 00604efcc..282e533af 100644 --- a/code/package.json +++ b/code/package.json | |||
@@ -52,6 +52,10 @@ | |||
52 | ], | 52 | ], |
53 | "commands": [ | 53 | "commands": [ |
54 | { | 54 | { |
55 | "command": "libsyntax-rust.createFile", | ||
56 | "title": "Show Rust syntax tree" | ||
57 | }, | ||
58 | { | ||
55 | "command": "libsyntax-rust.syntaxTree", | 59 | "command": "libsyntax-rust.syntaxTree", |
56 | "title": "Show Rust syntax tree" | 60 | "title": "Show Rust syntax tree" |
57 | }, | 61 | }, |
diff --git a/code/src/extension.ts b/code/src/extension.ts index c25e8cb61..b9d009776 100644 --- a/code/src/extension.ts +++ b/code/src/extension.ts | |||
@@ -81,11 +81,21 @@ export function activate(context: vscode.ExtensionContext) { | |||
81 | let e = await vscode.window.showTextDocument(doc) | 81 | let e = await vscode.window.showTextDocument(doc) |
82 | e.revealRange(range, vscode.TextEditorRevealType.InCenter) | 82 | e.revealRange(range, vscode.TextEditorRevealType.InCenter) |
83 | }) | 83 | }) |
84 | console.log("ping") | 84 | |
85 | registerCommand('libsyntax-rust.run', async (cmd: ProcessSpec) => { | 85 | registerCommand('libsyntax-rust.run', async (cmd: ProcessSpec) => { |
86 | let task = createTask(cmd) | 86 | let task = createTask(cmd) |
87 | await vscode.tasks.executeTask(task) | 87 | await vscode.tasks.executeTask(task) |
88 | }) | 88 | }) |
89 | registerCommand('libsyntax-rust.createFile', async (uri_: string) => { | ||
90 | console.log(`uri: ${uri_}`) | ||
91 | let uri = vscode.Uri.parse(uri_) | ||
92 | let edit = new vscode.WorkspaceEdit() | ||
93 | edit.createFile(uri) | ||
94 | await vscode.workspace.applyEdit(edit) | ||
95 | let doc = await vscode.workspace.openTextDocument(uri) | ||
96 | await vscode.window.showTextDocument(doc) | ||
97 | console.log("Done") | ||
98 | }) | ||
89 | 99 | ||
90 | dispose(vscode.workspace.registerTextDocumentContentProvider( | 100 | dispose(vscode.workspace.registerTextDocumentContentProvider( |
91 | 'libsyntax-rust', | 101 | 'libsyntax-rust', |