|
3 | 3 | // (c) 2016 Ecmel Ercan |
4 | 4 |
|
5 | 5 | import * as vsc from 'vscode'; |
6 | | -import * as lc from 'vscode-languageclient'; |
7 | 6 | import * as lst from 'vscode-languageserver-types'; |
8 | 7 | import * as css from 'vscode-css-languageservice'; |
9 | 8 | import * as fs from 'fs'; |
@@ -40,7 +39,7 @@ class Snippet { |
40 | 39 |
|
41 | 40 | class StyleServer implements vsc.CompletionItemProvider, vsc.HoverProvider { |
42 | 41 |
|
43 | | - private regex = [/style=["|']([^"^']*$)/, /<style[\s\S]*>([^<]*$)/]; |
| 42 | + private regex = [/style=["|']([^"^']*$)/i, /<style[\s\S]*>([^<]*$)/i]; |
44 | 43 |
|
45 | 44 | private convertCompletionList(list: lst.CompletionList): vsc.CompletionList { |
46 | 45 | let ci: vsc.CompletionItem[] = []; |
@@ -101,7 +100,7 @@ class StyleServer implements vsc.CompletionItemProvider, vsc.HoverProvider { |
101 | 100 |
|
102 | 101 | class ClassServer implements vsc.CompletionItemProvider { |
103 | 102 |
|
104 | | - private regex = [/class=["|']([^"^']*$)/, /<style[\s\S]*>([\s\S]*)<\/style>/g]; |
| 103 | + private regex = [/class=["|']([^"^']*$)/i, /<style[\s\S]*>([\s\S]*)<\/style>/ig]; |
105 | 104 |
|
106 | 105 | provideCompletionItems(document: vsc.TextDocument, position: vsc.Position, token: vsc.CancellationToken): vsc.CompletionList { |
107 | 106 | let start = new vsc.Position(0, 0); |
@@ -227,24 +226,6 @@ export function activate(context: vsc.ExtensionContext) { |
227 | 226 | let classServer = new ClassServer(); |
228 | 227 |
|
229 | 228 | context.subscriptions.push(vsc.languages.registerCompletionItemProvider('html', classServer)); |
230 | | - |
231 | | - |
232 | | - // LANGUAGE CLIENT |
233 | | - |
234 | | - let serverModule = context.asAbsolutePath(path.join('out', 'srv', 'server.js')); |
235 | | - let debugOptions = { execArgv: ["--nolazy", "--debug=6004"] }; |
236 | | - |
237 | | - let serverOptions: lc.ServerOptions = { |
238 | | - run: { module: serverModule, transport: lc.TransportKind.ipc }, |
239 | | - debug: { module: serverModule, transport: lc.TransportKind.ipc, options: debugOptions } |
240 | | - } |
241 | | - |
242 | | - let clientOptions: lc.LanguageClientOptions = { |
243 | | - documentSelector: ['html'] |
244 | | - } |
245 | | - |
246 | | - let client = new lc.LanguageClient('HTML CSS Support', serverOptions, clientOptions).start(); |
247 | | - context.subscriptions.push(client); |
248 | 229 | } |
249 | 230 |
|
250 | 231 | export function deactivate() { |
|
0 commit comments