(commandContext: azdata.ObjectExplorerContext)
| 142 | } |
| 143 | |
| 144 | export async function getHdfsFileAsString(commandContext: azdata.ObjectExplorerContext): Promise<{ contents: string, fsUriPath: string } | undefined> { |
| 145 | const extension = vscode.extensions.getExtension('Microsoft.mssql'); |
| 146 | if (extension) { |
| 147 | const extensionApi: MssqlExtensionApi = extension.exports; |
| 148 | const browser = extensionApi.getMssqlObjectExplorerBrowser(); |
| 149 | const node: IFileNode = await browser.getNode<IFileNode>(commandContext); |
| 150 | const contents = await node.getFileContentsAsString(); |
| 151 | if (contents !== undefined) { |
| 152 | return { |
| 153 | contents, |
| 154 | fsUriPath: node.getNodeInfo().label, |
| 155 | }; |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | export function deactivate() { |
| 161 | vscode.commands.executeCommand('setContext', 'showVisualizer', false); |
no test coverage detected