Added formatted tables

This commit is contained in:
Thorsten Muerell
2017-10-30 15:27:42 +01:00
parent 3a9674e80b
commit b8e46a6270
5 changed files with 15 additions and 71 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,4 @@
out
node_modules
.vscode-test/
.vsix
*.vsix

View File

@@ -1,65 +1,3 @@
# frog README
# frog
This is the README for your extension "frog". After writing up a brief description, we recommend including the following sections.
## Features
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
For example if there is an image subfolder under your extension project workspace:
\!\[feature X\]\(images/feature-x.png\)
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
## Requirements
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
## Extension Settings
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
For example:
This extension contributes the following settings:
* `myExtension.enable`: enable/disable this extension
* `myExtension.thing`: set to `blah` to do something
## Known Issues
Calling out known issues can help limit users opening duplicate issues against your extension.
## Release Notes
Users appreciate release notes as you update your extension.
### 1.0.0
Initial release of ...
### 1.0.1
Fixed issue #.
### 1.1.0
Added features X, Y, and Z.
-----------------------------------------------------------------------------------------------------------
## Working with Markdown
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
* Split the editor (`Cmd+\` on OSX or `Ctrl+\` on Windows and Linux)
* Toggle preview (`Shift+CMD+V` on OSX or `Shift+Ctrl+V` on Windows and Linux)
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (OSX) to see a list of Markdown snippets
### For more information
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
**Enjoy!**
This is a better TOAD.

Binary file not shown.

View File

@@ -47,6 +47,7 @@
"typescript": "^2.5.3",
"vscode": "^1.1.5",
"@types/node": "^7.0.43",
"@types/mocha": "^2.2.42"
"@types/mocha": "^2.2.42",
"text-table-formatter": "^0.1.0"
}
}

View File

@@ -5,6 +5,7 @@ import * as vscode from 'vscode';
import { ConnectionProvider, ConnectionNode } from './connections'
const { spawn } = require('child_process');
const table = require('text-table');
const extensionName = "frog";
var dbSession = null;
@@ -78,17 +79,21 @@ export function activate(context: vscode.ExtensionContext) {
diagnosticCollection.set(document.uri, diagnostics);
}
} else {
const data = []
data.push(json['columnDefinitions'].map((x) => x['name']));
for (let row of json["rows"]) {
myOutputChannel.append("--- ROW ---\n");
for (let [index, value] of row["columns"].entries()) {
myOutputChannel.append(cd[index]['name'] + " " + value['value'] + "\n");
}
data.push(row['columns'].map((x) => x['value']));
}
var t = table(data, { hsep: ' | '});
myOutputChannel.append(t);
myOutputChannel.append("\n");
}
myOutputChannel.append("-- " + new Date() + " -------------------------------\n");
outputBuffer = "";
} catch (e) {}
} catch (e) {
console.log(e);
}
});
dbSession.stderr.on('data', (data) => {