Update SQL language configuration to handle auto-closing characters (#426)
* Update the SQL lanaguage configuration to better handle auto-closing characters. * Remove contents of configuration file.
This commit is contained in:
Родитель
900a58e175
Коммит
bbd2d5986f
|
@ -4,7 +4,7 @@
|
|||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
import { ExtensionContext, workspace } from 'vscode';
|
||||
import { ExtensionContext, workspace, languages } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, ServerOptions,
|
||||
TransportKind, RequestType, NotificationType, NotificationHandler,
|
||||
ErrorAction, CloseAction } from 'vscode-languageclient';
|
||||
|
@ -146,9 +146,43 @@ export default class SqlToolsServiceClient {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the SQL language configuration
|
||||
*
|
||||
* @memberOf SqlToolsServiceClient
|
||||
*/
|
||||
private initializeLanguageConfiguration(): void {
|
||||
languages.setLanguageConfiguration('sql', {
|
||||
comments: {
|
||||
lineComment: '--',
|
||||
blockComment: ['/*', '*/']
|
||||
},
|
||||
|
||||
brackets: [
|
||||
['{', '}'],
|
||||
['[', ']'],
|
||||
['(', ')']
|
||||
],
|
||||
|
||||
__characterPairSupport: {
|
||||
autoClosingPairs: [
|
||||
{ open: '{', close: '}' },
|
||||
{ open: '[', close: ']' },
|
||||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"', notIn: ['string'] },
|
||||
{ open: '\'', close: '\'', notIn: ['string', 'comment'] }
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private initializeService(runtime: Runtime, context: ExtensionContext): Promise<boolean> {
|
||||
return new Promise<boolean>( (resolve, reject) => {
|
||||
let self = this;
|
||||
|
||||
return new Promise<boolean>( (resolve, reject) => {
|
||||
this._server.getServerPath(runtime).then(serverPath => {
|
||||
self.initializeLanguageConfiguration();
|
||||
|
||||
let serverArgs = [];
|
||||
let serverCommand = serverPath;
|
||||
if (serverPath === undefined) {
|
||||
|
|
|
@ -1,18 +1,3 @@
|
|||
{
|
||||
"comments": {
|
||||
"lineComment": "--",
|
||||
"blockComment": [ "/*", "*/" ]
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
]
|
||||
|
||||
// enhancedBrackets:[
|
||||
// { openTrigger: 'n', open: /begin$/i, closeComplete: 'end', matchCase: true },
|
||||
// { openTrigger: 'e', open: /case$/i, closeComplete: 'end', matchCase: true },
|
||||
// { openTrigger: 'n', open: /when$/i, closeComplete: 'then', matchCase: true }
|
||||
// ],
|
||||
// noindentBrackets: '()',
|
||||
}
|
Загрузка…
Ссылка в новой задаче