aboutsummaryrefslogtreecommitdiff
path: root/code/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-11 14:10:34 +0100
committerAleksey Kladov <[email protected]>2018-08-11 14:10:34 +0100
commitfe1fe866f3fd0a7bb542debaae782470f107b7c1 (patch)
tree1eca71fdceee0c90efbe306a25771ca11fc79345 /code/src
parentce06a9ddcb6762a10c4a676541ec670e8c7e214d (diff)
Simplify code
Diffstat (limited to 'code/src')
-rw-r--r--code/src/extension.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/code/src/extension.ts b/code/src/extension.ts
index bdad1568a..0fa092573 100644
--- a/code/src/extension.ts
+++ b/code/src/extension.ts
@@ -26,15 +26,13 @@ export function activate(context: vscode.ExtensionContext) {
26 let request: ExtendSelectionParams = { 26 let request: ExtendSelectionParams = {
27 textDocument: { uri: editor.document.uri.toString() }, 27 textDocument: { uri: editor.document.uri.toString() },
28 selections: editor.selections.map((s) => { 28 selections: editor.selections.map((s) => {
29 return { start: s.start, end: s.end }; 29 return client.code2ProtocolConverter.asRange(s)
30 }) 30 })
31 } 31 }
32 let response = await client.sendRequest<ExtendSelectionResult>("m/extendSelection", request) 32 let response = await client.sendRequest<ExtendSelectionResult>("m/extendSelection", request)
33 editor.selections = response.selections.map((range) => { 33 editor.selections = response.selections.map((range) => {
34 return new vscode.Selection( 34 let r = client.protocol2CodeConverter.asRange(range)
35 new vscode.Position(range.start.line, range.start.character), 35 return new vscode.Selection(r.start, r.end)
36 new vscode.Position(range.end.line, range.end.character),
37 )
38 }) 36 })
39 }) 37 })
40 38
@@ -158,7 +156,9 @@ function setHighlights(
158 console.log(`unknown tag ${d.tag}`) 156 console.log(`unknown tag ${d.tag}`)
159 continue 157 continue
160 } 158 }
161 byTag[d.tag].push(d.range) 159 byTag[d.tag].push(
160 client.protocol2CodeConverter.asRange(d.range)
161 )
162 } 162 }
163 163
164 for (let tag in byTag) { 164 for (let tag in byTag) {