Skip to content

Commit a2e2142

Browse files
Merge pull request #601 from DustinCampbell/merge-master-into-release
Merge master into release
2 parents 05c876c + 8a33c49 commit a2e2142

38 files changed

+1018
-698
lines changed

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,40 @@ Welcome to the C# extension for Visual Studio Code! This preview provides the fo
99
* Lightweight development tools for [.NET Core](https://dotnet.github.io).
1010
* Great C# editing support, including Syntax Highlighting, IntelliSense, Go to Definition, Find All References, etc.
1111
* Debugging support for .NET Core (CoreCLR). NOTE: Mono and Desktop CLR debugging is not supported.
12-
* Support for project.json projects on Windows, OS X and Linux, and csproj projects on Windows.
12+
* Support for project.json projects on Windows, macOS and Linux, and csproj projects on Windows.
1313

1414
The C# extension is powered by [OmniSharp](https://github.com/OmniSharp/omnisharp-roslyn).
1515

16-
### **Important!** Breaking Changes as of 1.2
17-
18-
* The C# extension now only supports .NET Core 1.0. Please upgrade any RC1 or RC2 projects to the 1.0.0 release build.
19-
* **Support for .csproj projects is partially functional on OS X and Linux.** This will impact anyone doing .csproj development on OS X or Linux (e.g. Unity, Xamarin, etc.). We are working to address this in the near future. However, for now, you can use the [Legacy C# Support extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.omnisharp).
16+
### What's New in 1.3
17+
18+
* Support for Unity and Mono development on macOS and Linux has been restored! This release brings back support for the Mono version of OmniSharp, which is used to provide *much* better support for .csproj/.sln projects. Please note that Mono version 4.0.1 or newer is required.
19+
* Generation of tasks.json and launch.json files can now properly handle nested projects. [#170](https://github.com/OmniSharp/omnisharp-vscode/issues/170)
20+
* New UI that makes it easy to select a process ID when attaching the debugger to another process. Note: If you have an existing launch.json file, you can re-generate it by deleting the file, closing your workspace in Visual Studio Code and opening it again. Or, you can open the launch.json file and change the `processId` value to `"${command.pickProcess}"`.
21+
* Support for debugging in .cshtml files. To enable this, add a `sourceFileMap` entry to your launch.json with the following content: `"sourceFileMap": { "/Views": "${workspaceRoot}/Views" }`
22+
* Support for conditional breakpoints
23+
* New support for changing variable values in the debugger! To try this, just right-click on the variable name and select 'Set Value'. Note: To properly support this feature, we've changed the display of variable type names in the debugger to a shortened form. The full type name can be viewed by hovering over the name with the mouse.
24+
* New configuration option to enable [stepping into properties and operators](https://github.com/OmniSharp/omnisharp-vscode/blob/release/debugger.md#stepping-into-properties-and-operators).
25+
* Duplicate warnings and errors should no longer accumulate in Unity projects [#447](https://github.com/OmniSharp/omnisharp-vscode/issues/447)
26+
27+
### Supported Operating Systems
28+
29+
* Currently, the C# extension supports the following operatings systems:
30+
* Windows (64-bit only)
31+
* macOS
32+
* Ubuntu 14.04 / Linux Mint 17
33+
* Ubuntu 16.04
34+
* Debian 8.2
35+
* CentOS 7.1 / Oracle Linux 7
36+
* Red Hat Enterprise Linux (RHEL)
37+
* Fedora 23
38+
* OpenSUSE 13.2
2039

2140
### Found a Bug?
2241
Please file any issues at https://github.com/OmniSharp/omnisharp-vscode/issues.
2342

2443
### Debugging
2544
The C# extension now supports basic debugging capabilities! See http://aka.ms/vscclrdebugger for details.
2645

27-
### What's new in C# extension version 1.2
28-
29-
* Adds debugger support for new Linux versions: Ubuntu 16.04, Fedora 23, openSUSE 13.2, and Oracle Linux 7.1
30-
* Enhanced debug console output: module loads are now output, and there are launch.json options for controlling what is output
31-
* Source file checksum support for breakpoints. This ensures that the debugger only sets breakpoints in code that exactly matches the open document.
32-
* Support for editing the value of variables in the watch and locals window (requires VS Code 1.3)
33-
3446
### Development
3547

3648
First install:

debugger.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ This page gives you detailed instructions on how to debug code running under .NE
55
File bugs and feature requests [here](https://github.com/OmniSharp/omnisharp-vscode/issues) and [join our insiders group](http://landinghub.visualstudio.com/dotnetcoreinsiders) to help us build great tooling for .NET Core.
66

77
####Requirements
8-
* Requires .NET Core 1.0 RC2 or newer (will not work with earlier versions)
8+
* Requires .NET Core 1.0 (rc2 are earlier releases are not supported)
99
* X64 only
10-
* Supports OSX, Ubuntu 14.04, Red Hat Enterprise Linux 7.2, Debian 8.2, Centos 7.1, and Windows 7+
10+
* Supported operating systems:
11+
* macOS: 10.11+ (El Capitan+)
12+
* Linux: Red Hat Enterprise Linux 7.2+, Ubuntu 14.04 LTS, Ubuntu 16.04 LTS, Debian 8.2+, Linux Mint 17+, CentOS 7.1+, Oracle Linux 7.1+, Fedora 23, openSUSE 13.2
13+
* Windows: 7+
1114

1215
###First Time setup
1316
##### 1: Get Visual Studio Code
@@ -26,7 +29,7 @@ Install the .NET Core command line tools (CLI) by following the installation par
2629
##### 3: Install C# Extension for VS Code
2730
Open the command palette in VS Code (F1) and type "ext install C#" to trigger the installation of the extension. VS Code will show a message that the extension has been installed and it will restart.
2831

29-
If you have previously installed the C# extension, make sure that you have version 1.1.6 or newer. You can check this by opening the command palette (F1) and running 'Extensions: Show Installed Extensions'.
32+
If you have previously installed the C# extension, make sure that you have version 1.2 or newer. You can check this by opening the command palette (F1) and running 'Extensions: Show Installed Extensions'.
3033

3134
##### 4: Wait for download of platform-specific files
3235
The first time that C# code is opened in VS Code, the extension will download the platform-specific files needed for debugging and editing. Debugging and editor features will not work until these steps finish.
@@ -49,7 +52,7 @@ You can also find some example projects on https://github.com/aspnet/cli-samples
4952
##### 2: Open the directory in VS Code
5053
Go to File->Open and open the directory in Visual Studio Code. If this is the first time that the C# extension has been activated, it will now download additional platform-specific dependencies.
5154

52-
**Troubleshooting 'Error while installing .NET Core Debugger':** If the debugger is failing to download its platform-specific dependencies, first verify that you have the 1.0.0-preview1-002702 or newer build of the .NET CLI installed, and it is functioning. You can check this by starting a bash/command prompt and running 'dotnet --info'.
55+
**Troubleshooting 'Error while installing .NET Core Debugger':** If the debugger is failing to download its platform-specific dependencies, first verify that you have the 1.0.0-preview2-003121 or newer build of the .NET CLI installed, and it is functioning. You can check this by starting a bash/command prompt and running 'dotnet --info'.
5356

5457
If the CLI is installed, here are a few additional suggestions:
5558

@@ -111,7 +114,7 @@ You can optionally disable justMyCode by setting it to "false". You should disab
111114
Just My Code is a set of features that makes it easier to focus on debugging your code by hiding some of the details of optimized libraries that you might be using, like the .NET Framework itself. The most important sub parts of this feature are --
112115

113116
* User-unhandled exceptions: automatically stop the debugger just before exceptions are about to be caught by the framework
114-
* Just My Code stepping: when stepping, if framework code calls back to user code, automaticially stop.
117+
* Just My Code stepping: when stepping, if framework code calls back to user code, automatically stop.
115118

116119
#####Source File Map
117120
You can optionally configure a file by file mapping by providing map following this schema:
@@ -133,10 +136,22 @@ Environment variables may be passed to your program using this schema:
133136
}
134137

135138
#####External console (terminal) window
136-
The target process can optionally launch into a seperate console window. You will want this if your console app takes console input (ex: Console.ReadLine). This can be enabled with:
139+
The target process can optionally launch into a separate console window. You will want this if your console app takes console input (ex: Console.ReadLine). This can be enabled with:
137140

138141
"externalConsole": true
139142

143+
##### Stepping into properties and operators
144+
The debugger steps over properties and operators in managed code by default. In most cases, this provides a better debugging experience. To change this and enable stepping into properties or operators add:
145+
146+
"enableStepFiltering": false
147+
148+
#### Attach Support
149+
The C# debugger supports attaching to processes. To do this, switch to the Debug tab, and open the configuration drop down.
150+
151+
![Debug launch configuration drop down](https://raw.githubusercontent.com/wiki/OmniSharp/omnisharp-vscode/images/debug-launch-configurations.png)
152+
153+
Select the '.NET Core Attach' configuration. Clicking the play button (or pressing F5) will then try to attach. In launch.json, if `processId` is set to `"${command.pickProcess}"` this will provide UI to select which process to attach to.
154+
140155
#### Docker Support
141156

142157
Using Visual Studio Code and the C# extension it is also possible to debug your code running in a [Docker container](https://en.wikipedia.org/wiki/Docker_(software)). To do so, follow instructions to install and run [yo docker](https://github.com/Microsoft/generator-docker#generator-docker). This will add files to your project to build a container, and it will add a new debug launch configuration which will invoke a container build, and then debug your app in the container.

gulpfile.js

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ const vsce = require('vsce');
1515
const debugUtil = require('./out/coreclr-debug/util.js');
1616
const debugInstall = require('./out/coreclr-debug/install.js');
1717
const fs_extra = require('fs-extra-promise');
18-
const omnisharpDownload = require('./out/omnisharpDownload');
18+
const omnisharp = require('./out/omnisharp/omnisharp');
19+
const download = require('./out/omnisharp/download');
20+
const platform = require('./out/platform');
1921
const child_process = require('child_process');
2022

21-
const OmniSharpVersion = omnisharpDownload.OmniSharpVersion;
23+
const Flavor = omnisharp.Flavor;
24+
const Platform = platform.Platform;
2225

2326
/// used in offline packaging run so does not clean .vsix
2427
function clean() {
@@ -31,9 +34,11 @@ gulp.task('clean', ['omnisharp:clean', 'debugger:clean', 'package:clean'], () =
3134
});
3235

3336
/// Omnisharp Tasks
34-
function installOmnisharp(omnisharpAssetName) {
35-
const logFunction = (message) => { console.log(message); };
36-
return omnisharpDownload.downloadOmnisharp(logFunction, omnisharpAssetName);
37+
function installOmnisharp(omnisharps) {
38+
const logger = (message) => { console.log(message); };
39+
const promises = omnisharps.map((omni) => download.go(omni.flavor, omni.platform, logger));
40+
41+
return Promise.all(promises);
3742
}
3843

3944
function cleanOmnisharp() {
@@ -45,8 +50,10 @@ gulp.task('omnisharp:clean', () => {
4550
});
4651

4752
gulp.task('omnisharp:install', ['omnisharp:clean'], () => {
48-
var asset = gulpUtil.env.asset || omnisharpDownload.getOmnisharpAssetName();
49-
return installOmnisharp(asset);
53+
const flavor = gulpUtil.env.flavor || Flavor.CoreCLR;
54+
const platform = gulpUtil.env.platform || platform.getCurrentPlatform();
55+
56+
return installOmnisharp([{flavor, platform}]);
5057
});
5158

5259
/// Debugger Tasks
@@ -97,11 +104,11 @@ function doPackageSync(packageName) {
97104
}
98105
}
99106

100-
function doOfflinePackage(runtimeId, omnisharpAsset, packageName) {
107+
function doOfflinePackage(runtimeId, omnisharps, packageName) {
101108
return clean().then(() => {
102109
return installDebugger(runtimeId);
103110
}).then(() => {
104-
return installOmnisharp(omnisharpAsset);
111+
return installOmnisharp(omnisharps);
105112
}).then(() => {
106113
doPackageSync(packageName + '-' + runtimeId + '.vsix');
107114
});
@@ -122,21 +129,21 @@ gulp.task('package:offline', ['clean'], () => {
122129
var packageName = name + '.' + version;
123130

124131
var packages = [];
125-
packages.push({rid: 'win7-x64', omni: `omnisharp-${OmniSharpVersion}-win-x64-net451.zip`});
126-
packages.push({rid: 'osx.10.11-x64', omni: `omnisharp-${OmniSharpVersion}-osx-x64-netcoreapp1.0.tar.gz`});
127-
packages.push({rid: 'centos.7-x64', omni: `omnisharp-${OmniSharpVersion}-centos-x64-netcoreapp1.0.tar.gz`});
128-
packages.push({rid: 'debian.8-x64', omni: `omnisharp-${OmniSharpVersion}-debian-x64-netcoreapp1.0.tar.gz`});
129-
packages.push({rid: 'fedora.23-x64', omni: `omnisharp-${OmniSharpVersion}-fedora-x64-netcoreapp1.0.tar.gz`});
130-
packages.push({rid: 'opensuse.13.2-x64', omni: `omnisharp-${OmniSharpVersion}-opensuse-x64-netcoreapp1.0.tar.gz`});
131-
packages.push({rid: 'rhel.7.2-x64', omni: `omnisharp-${OmniSharpVersion}-rhel-x64-netcoreapp1.0.tar.gz`});
132-
packages.push({rid: 'ubuntu.14.04-x64', omni: `omnisharp-${OmniSharpVersion}-ubuntu14-x64-netcoreapp1.0.tar.gz`});
133-
packages.push({rid: 'ubuntu.16.04-x64', omni: `omnisharp-${OmniSharpVersion}-ubuntu16-x64-netcoreapp1.0.tar.gz`});
132+
packages.push({rid: 'win7-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Windows}, {flavor: Flavor.Desktop, platform: Platform.Windows}]});
133+
packages.push({rid: 'osx.10.11-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.OSX}]});
134+
packages.push({rid: 'centos.7-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.CentOS}]});
135+
packages.push({rid: 'debian.8-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Debian}]});
136+
packages.push({rid: 'fedora.23-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Fedora}]});
137+
packages.push({rid: 'opensuse.13.2-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.OpenSUSE}]});
138+
packages.push({rid: 'rhel.7.2-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.RHEL}]});
139+
packages.push({rid: 'ubuntu.14.04-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Ubuntu14}]});
140+
packages.push({rid: 'ubuntu.16.04-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Ubuntu16}]});
134141

135142
var promise = Promise.resolve();
136143

137-
packages.forEach(pair => {
144+
packages.forEach(data => {
138145
promise = promise.then(() => {
139-
return doOfflinePackage(pair.rid, pair.omni, packageName);
146+
return doOfflinePackage(data.rid, data.omnisharps, packageName);
140147
})
141148
});
142149

package.json

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "csharp",
33
"publisher": "ms-vscode",
4-
"version": "1.2.2",
4+
"version": "1.3.0",
55
"description": "C# for Visual Studio Code (powered by OmniSharp).",
66
"displayName": "C#",
77
"author": "Microsoft Corporation",
@@ -17,7 +17,7 @@
1717
"Linters",
1818
"Snippets"
1919
],
20-
"main": "./out/omnisharpMain",
20+
"main": "./out/main",
2121
"scripts": {
2222
"postinstall": "node ./node_modules/vscode/bin/install && tsc"
2323
},
@@ -39,11 +39,11 @@
3939
"tslint": "^3.3.0",
4040
"tslint-microsoft-contrib": "^2.0.0",
4141
"typescript": "^1.7.3",
42-
"vscode": "^0.11.3",
43-
"vsce": "^1.3.0"
42+
"vscode": "^0.11.13",
43+
"vsce": "^1.7.0"
4444
},
4545
"engines": {
46-
"vscode": "^0.10.10"
46+
"vscode": "^1.3.0"
4747
},
4848
"activationEvents": [
4949
"onLanguage:csharp",
@@ -144,7 +144,8 @@
144144
"label": ".NET Core",
145145
"enableBreakpointsFor": {
146146
"languageIds": [
147-
"csharp"
147+
"csharp",
148+
"razor"
148149
]
149150
},
150151
"runtime": "node",
@@ -308,6 +309,11 @@
308309
"description": "Optional flag to require current source code to match the pdb.",
309310
"default": true
310311
},
312+
"enableStepFiltering": {
313+
"type": "boolean",
314+
"description": "Optional flag to enable stepping over Properties and Operators.",
315+
"default": true
316+
},
311317
"logging": {
312318
"type": "object",
313319
"required": [],
@@ -497,9 +503,18 @@
497503
"default": "The process name to attach to. If this is used, 'processId' should not be used."
498504
},
499505
"processId": {
500-
"type": "integer",
501-
"description": "The process id to attach to. If this is used, 'processName' should not be used.",
502-
"default": 0
506+
"anyOf": [
507+
{
508+
"type": "string",
509+
"description": "The process id to attach to. Use \"${command.pickProcesss}\" to get a list of running processes to attach to. If 'processId' used, 'processName' should not be used.",
510+
"default": "${command.pickProcess}"
511+
},
512+
{
513+
"type": "integer",
514+
"description": "The process id to attach to. Use \"${command.pickProcesss}\" to get a list of running processes to attach to. If 'processId' used, 'processName' should not be used.",
515+
"default": 0
516+
}
517+
]
503518
},
504519
"sourceFileMap": {
505520
"type": "object",
@@ -526,6 +541,11 @@
526541
"description": "Optional flag to require current source code to match the pdb.",
527542
"default": true
528543
},
544+
"enableStepFiltering": {
545+
"type": "boolean",
546+
"description": "Optional flag to enable stepping over Properties and Operators.",
547+
"default": true
548+
},
529549
"logging": {
530550
"type": "object",
531551
"required": [],
@@ -604,13 +624,16 @@
604624
},
605625
"env": {
606626
"ASPNETCORE_ENVIRONMENT": "Development"
627+
},
628+
"sourceFileMap": {
629+
"/Views": "${workspaceRoot}/Views"
607630
}
608631
},
609632
{
610633
"name": ".NET Core Attach",
611634
"type": "coreclr",
612635
"request": "attach",
613-
"processId": 0
636+
"processId": "${command.pickProcess}"
614637
}
615638
]
616639
}

snippets/csharp.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,5 +520,34 @@
520520
"}"
521521
],
522522
"description": "While loop"
523+
},
524+
525+
"constructor": {
526+
527+
"prefix": "ctor",
528+
"body": [
529+
"${1:public} ${2:ClassName} (${3:Parameters})",
530+
"{",
531+
" ${0}",
532+
"}"
533+
],
534+
"description": "constructor"
535+
},
536+
537+
"xUnit Test": {
538+
539+
"prefix": "fact",
540+
"body": [
541+
"[Fact]",
542+
"public void ${1:TestName}()",
543+
"{",
544+
"//Given",
545+
"",
546+
"//When",
547+
"",
548+
"//Then",
549+
"}${0}"
550+
],
551+
"description": "create xunit test method"
523552
}
524-
}
553+
}

0 commit comments

Comments
 (0)