From 8c3f0e3e2cb93147d3fa654a0a6dad3cde078c49 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Tue, 12 Jun 2018 23:49:52 +0100 Subject: [PATCH] Got tasks and launch setup all gucci, and the error squiggle goes to the end ofthe line now :ok_hand: --- .vscode/launch.json | 2 +- .vscode/tasks.json | 129 ++++++++++++++++++------------------------- package.json | 1 - server/src/linter.ts | 2 +- 4 files changed, 57 insertions(+), 77 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8508d95..ded2955 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "stopOnEntry": false, "sourceMaps": true, "outFiles": ["${workspaceRoot}/client/out/**/*.js"], - //"preLaunchTask": "npm: watch:client" + "preLaunchTask": "watch" }, { "type": "node", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e80608b..7d0916a 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,75 +1,56 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "compile", - "dependsOn": [ - "compile:client", - "compile:server" - ], - "problemMatcher": [] - }, - { - "type": "npm", - "script": "compile:client", - "group": "build", - "presentation": { - "panel": "dedicated", - "reveal": "never" - }, - "problemMatcher": [ - "$tsc" - ] - }, - { - "type": "npm", - "script": "compile:server", - "group": "build", - "presentation": { - "panel": "dedicated", - "reveal": "never" - }, - "problemMatcher": [ - "$tsc" - ] - }, - { - "label": "watch", - "dependsOn": [ - "watch:client", - "watch:server" - ], - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [] - }, - { - "type": "npm", - "script": "watch:client", - "isBackground": true, - "group": "build", - "presentation": { - "panel": "dedicated", - "reveal": "never" - }, - "problemMatcher": [ - "$tsc-watch" - ] - }, - { - "type": "npm", - "script": "watch:server", - "isBackground": true, - "group": "build", - "presentation": { - "panel": "dedicated", - "reveal": "never" - }, - "problemMatcher": [ - "$tsc-watch" - ] - } - ] +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "compile", + "problemMatcher": [ + "$tsc" + ] + }, + { + "type": "npm", + "script": "compile:client", + "problemMatcher": [ + "$tsc" + ] + }, + { + "type": "npm", + "script": "compile:server", + "problemMatcher": [ + "$tsc" + ] + }, + { + "type": "npm", + "script": "watch:client", + "isBackground": true, + "problemMatcher": [ + "$tsc-watch" + ] + }, + { + "type": "npm", + "script": "watch:server", + "isBackground": true, + "presentation": { + "reveal": "never", + "panel": "dedicated" + }, + "problemMatcher": [ + "$tsc-watch" + ] + }, + { + "label": "watch", + "isBackground": true, + "dependsOn": [ + "npm: watch:server", + "npm: watch:client" + ] + } + ] } \ No newline at end of file diff --git a/package.json b/package.json index d1a44ef..76093d6 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "vscode:prepublish": "cd client && npm run update-vscode && cd .. && npm run compile", "postinstall": "cd server && npm install && cd ../client && npm install && cd ..", "compile": "npm run compile:client && npm run compile:server", - "run": "concurrently \"npm run watch:client\" \"npm run watch:server\"", "compile:client": "tsc -p ./client/tsconfig.json", "compile:server": "tsc -p ./server/tsconfig.json", "watch:client": "tsc -w -p ./client/tsconfig.json", diff --git a/server/src/linter.ts b/server/src/linter.ts index 6646f46..bbbc5f9 100644 --- a/server/src/linter.ts +++ b/server/src/linter.ts @@ -82,7 +82,7 @@ function lint(text: string, uri: string) { function calcRange(lineNum: number, uri: string): Range { const line = documents.get(uri).getText().split('\n')[lineNum - 1] - return Range.create(lineNum - 1, line.length - line.leftTrim().length, lineNum - 1, prepareLine(line).length) + return Range.create(lineNum - 1, line.length - line.leftTrim().length, lineNum - 1, prepareLine(line).length + 1) } function prepareLine(line: string): string {