Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.6.1 (December 22, 2016)

* Fix crash when tasks.json contains comments. ([#1074](https://github.com/OmniSharp/omnisharp-vscode/issues/1074))

## 1.6.0 (December 21, 2016)

#### C# Scripting
Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "csharp",
"publisher": "ms-vscode",
"version": "1.6.0",
"version": "1.6.1",
"description": "C# for Visual Studio Code (powered by OmniSharp).",
"displayName": "C#",
"author": "Microsoft Corporation",
Expand Down Expand Up @@ -149,17 +149,17 @@
},
{
"description": ".NET Core Debugger (Windows / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-win7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-win7-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-win7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-win7-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"win7-x64"
]
},
{
"description": ".NET Core Debugger (macOS / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-osx.10.11-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-osx.10.11-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-osx.10.11-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-osx.10.11-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"osx.10.11-x64"
Expand All @@ -171,8 +171,8 @@
},
{
"description": ".NET Core Debugger (CentOS / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-centos.7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-centos.7-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-centos.7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-centos.7-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"centos.7-x64"
Expand All @@ -184,8 +184,8 @@
},
{
"description": ".NET Core Debugger (Debian / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-debian.8-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-debian.8-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-debian.8-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-debian.8-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"debian.8-x64"
Expand All @@ -197,8 +197,8 @@
},
{
"description": ".NET Core Debugger (Fedora 23 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-fedora.23-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-fedora.23-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-fedora.23-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-fedora.23-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"fedora.23-x64"
Expand All @@ -210,8 +210,8 @@
},
{
"description": ".NET Core Debugger (Fedora 24 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-fedora.24-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-fedora.24-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-fedora.24-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-fedora.24-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"fedora.24-x64"
Expand All @@ -223,8 +223,8 @@
},
{
"description": ".NET Core Debugger (OpenSUSE 13 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-opensuse.13.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-opensuse.13.2-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-opensuse.13.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-opensuse.13.2-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"opensuse.13.2-x64"
Expand All @@ -236,8 +236,8 @@
},
{
"description": ".NET Core Debugger (OpenSUSE 42 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-opensuse.42.1-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-opensuse.42.1-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-opensuse.42.1-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-opensuse.42.1-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"opensuse.42.1-x64"
Expand All @@ -249,8 +249,8 @@
},
{
"description": ".NET Core Debugger (RHEL / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-rhel.7.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-rhel.7.2-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-rhel.7.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-rhel.7.2-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"rhel.7-x64"
Expand All @@ -262,8 +262,8 @@
},
{
"description": ".NET Core Debugger (Ubuntu 14.04 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-ubuntu.14.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-ubuntu.14.04-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-ubuntu.14.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-ubuntu.14.04-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.14.04-x64"
Expand All @@ -275,8 +275,8 @@
},
{
"description": ".NET Core Debugger (Ubuntu 16.04 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-ubuntu.16.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-ubuntu.16.04-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-ubuntu.16.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-ubuntu.16.04-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.16.04-x64"
Expand All @@ -288,8 +288,8 @@
},
{
"description": ".NET Core Debugger (Ubuntu 16.10 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-2/coreclr-debug-ubuntu.16.10-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-2/coreclr-debug-ubuntu.16.10-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-3/coreclr-debug-ubuntu.16.10-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-3/coreclr-debug-ubuntu.16.10-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.16.10-x64"
Expand Down
24 changes: 16 additions & 8 deletions src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as tasks from 'vscode-tasks';
import { OmniSharpServer } from './omnisharp/server';
import * as serverUtils from './omnisharp/utils';
import * as protocol from './omnisharp/protocol';
import { tolerantParse } from './json';

interface DebugConfiguration {
name: string;
Expand Down Expand Up @@ -133,17 +134,15 @@ export class AssetGenerator {
}

let projectFileText = fs.readFileSync(this.projectFilePath, 'utf8');
projectFileText = projectFileText.replace(/^\uFEFF/, '');

if (path.basename(this.projectFilePath).toLowerCase() === 'project.json') {
let projectJsonObject: any;

try {
// TODO: This error should be surfaced to the user. If the JSON can't be parsed
// (maybe due to a syntax error like an extra comma), the user should be notified
// to fix up their project.json.
projectJsonObject = JSON.parse(projectFileText);
} catch (error) {
projectJsonObject = tolerantParse(projectFileText);
}
catch (error) {
vscode.window.showErrorMessage('Failed to parse project.json file');
projectJsonObject = null;
}

Expand Down Expand Up @@ -357,8 +356,17 @@ function getBuildOperations(tasksJsonPath: string) {
}

const text = buffer.toString();
const tasksJson: tasks.TaskConfiguration = JSON.parse(text);
const buildTask = tasksJson.tasks.find(td => td.taskName === 'build');

let buildTask: tasks.TaskDescription;

try {
const tasksJson: tasks.TaskConfiguration = tolerantParse(text);
buildTask = tasksJson.tasks.find(td => td.taskName === 'build');
}
catch (error) {
vscode.window.showErrorMessage(`Failed to parse tasks.json file`);
buildTask = undefined;
}

resolve({ updateTasksJson: (buildTask === undefined) });
});
Expand Down
2 changes: 1 addition & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ export function deleteInstallFile(type: InstallFileType): Promise<void> {
resolve();
});
});
}
}
Loading