Syntax highlighting for console

sql-parser
Thorsten Muerell 7 years ago
parent a07b3ccdba
commit 56704ac257

@ -143,18 +143,26 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(disposable, registration); context.subscriptions.push(disposable, registration);
function changeSession(node: ConnectionNode) {
currentConnection = node;
statusBarItem.text = node.name;
if (dbSession) {
dbSession.stdin.end();
dbSession = null;
}
}
vscode.commands.registerCommand('selectConnection', (node: ConnectionNode) => { vscode.commands.registerCommand('selectConnection', (node: ConnectionNode) => {
vscode.window.showInformationMessage(`You want to change the connection to '${node.name}'. Sure?`, 'Yes') if (!dbSession) {
.then( (selection) => { changeSession(node)
if (selection == 'Yes') { } else {
currentConnection = node; vscode.window.showInformationMessage(`You want to change the connection to '${node.name}'. Sure?`, 'Yes')
statusBarItem.text = node.name; .then( (selection) => {
if (dbSession) { if (selection == 'Yes') {
dbSession.stdin.end(); changeSession(node);
dbSession = null;
} }
} }, (reason) => {})
}, (reason) => {}) }
}) })
} }

@ -19,6 +19,30 @@
<key>name</key> <key>name</key>
<string>string.quoted</string> <string>string.quoted</string>
</dict> </dict>
<dict>
<key>match</key>
<string>Query successful.</string>
<key>name</key>
<string>keyword</string>
</dict>
<dict>
<key>match</key>
<string>Exception.*</string>
<key>name</key>
<string>invalid.illegal</string>
</dict>
<dict>
<key>match</key>
<string>Errors found:.*</string>
<key>name</key>
<string>invalid.illegal</string>
</dict>
<dict>
<key>match</key>
<string>^\d+:.*</string>
<key>name</key>
<string>invalid.illegal</string>
</dict>
</array> </array>
</dict> </dict>
</plist> </plist>
Loading…
Cancel
Save