Skip to content

Commit a8c42f2

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6d3dbb7 + 958ef0e commit a8c42f2

File tree

11 files changed

+530
-135
lines changed

11 files changed

+530
-135
lines changed

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
## 1.7.0 _(Not Yet Released)_
2+
3+
#### Syntax Hightlighting
4+
5+
* Introduced a brand new TextMate grammar written from scratch that provides much more robust C# syntax highlighting. ([#101](https://github.com/OmniSharp/omnisharp-vscode/issues/101), [#225](https://github.com/OmniSharp/omnisharp-vscode/issues/225), [#268](https://github.com/OmniSharp/omnisharp-vscode/issues/268), [#316](https://github.com/OmniSharp/omnisharp-vscode/issues/316), [#674](https://github.com/OmniSharp/omnisharp-vscode/issues/674), [#706](https://github.com/OmniSharp/omnisharp-vscode/issues/706), [#731](https://github.com/OmniSharp/omnisharp-vscode/issues/731), [#746](https://github.com/OmniSharp/omnisharp-vscode/issues/746), [#782](https://github.com/OmniSharp/omnisharp-vscode/issues/782), [#802](https://github.com/OmniSharp/omnisharp-vscode/issues/802), [#816](https://github.com/OmniSharp/omnisharp-vscode/issues/816), [#829](https://github.com/OmniSharp/omnisharp-vscode/issues/829), [#830](https://github.com/OmniSharp/omnisharp-vscode/issues/830), [#861](https://github.com/OmniSharp/omnisharp-vscode/issues/861), [#1078](https://github.com/OmniSharp/omnisharp-vscode/issues/1078), [#1084](https://github.com/OmniSharp/omnisharp-vscode/issues/1084), [#1086](https://github.com/OmniSharp/omnisharp-vscode/issues/1086), [#1091](https://github.com/OmniSharp/omnisharp-vscode/issues/1091), [#1096](https://github.com/OmniSharp/omnisharp-vscode/issues/1096), [#1097](https://github.com/OmniSharp/omnisharp-vscode/issues/1097), [#1106](https://github.com/OmniSharp/omnisharp-vscode/issues/1106), [#1115](https://github.com/OmniSharp/omnisharp-vscode/issues/1108))
6+
* The C# TextMate grammar has a new home! Issues and contributions are welcome at [https://github.com/dotnet/csharp-tmLanguage](https://github.com/dotnet/csharp-tmLanguage).
7+
8+
### Project Support
9+
10+
* Updated with the latest changes for .NET Core .csproj projects. ([omnisharp-roslyn#738](https://github.com/OmniSharp/omnisharp-roslyn/pull/738))
11+
* Properly handle .csproj projects in .sln files that were added via .NET CLI commands. ([omnisharp-roslyn#741](https://github.com/OmniSharp/omnisharp-roslyn/pull/741))
12+
* Respect `nowarn` in project.json projects ([omnisharp#734](https://github.com/OmniSharp/omnisharp-roslyn/pull/734)) _(Contributed by [@filipw](https://github.com/filipw))_
13+
* Correctly update project when dotnet restore is performed on a .NET Core .csproj project. ([#1114](https://github.com/OmniSharp/omnisharp-vscode/issues/1114))
14+
15+
### Debugging
16+
17+
* Enable debugger support for Zorin OS 12 ([#1160](https://github.com/OmniSharp/omnisharp-vscode/issues/1160)) _(Contributed by [@mkaziz](https://github.com/mkaziz))_
18+
19+
### C# Scripting
20+
21+
* Support resolving `#r` references from the GAC ([omnisharp-roslyn#721](https://github.com/OmniSharp/omnisharp-roslyn/pull/721)) _(Contributed by [@filipw](https://github.com/filipw))_
22+
* Include System.ValueTuple in C# scripts implicitly ([omnisharp-roslyn#722](https://github.com/OmniSharp/omnisharp-roslyn/pull/722)) _(Contributed by [@filipw](https://github.com/filipw))_
23+
24+
### Completion List
25+
26+
* A namespace icon should be displayed for namespaces in the completion list. ([#1125](https://github.com/OmniSharp/omnisharp-vscode/issues/1124)) _(Contributed by [@filipw](https://github.com/filipw))_
27+
* Add icons for several symbol kinds in the completion list, fixing many symbols that incorrectly displayed a property "wrench" icon. ([#1145](https://github.com/OmniSharp/omnisharp-vscode/issues/1145))
28+
29+
### Other Updates and Fixes
30+
31+
* Add schema validation for omnisharp.json files. ([#1082](https://github.com/OmniSharp/omnisharp-vscode/pull/1082)) _(Contributed by [@Thaina](https://github.com/Thaina))_
32+
* Fix running and debugging of tests defined in nested classes. ([#743](https://github.com/OmniSharp/omnisharp-vscode/issues/743), [#1151](https://github.com/OmniSharp/omnisharp-vscode/issues/1151))
33+
* Fix error when 'tasks.json' does not contain a 'tasks' node, or contains os-specific 'tasks' nodes. ([#1140](https://github.com/OmniSharp/omnisharp-vscode/issues/1140))
34+
* Better detection of Windows architecture (x86 or x64) when determining extension dependencies to download. The detection logic now uses well-known environment variables rather than launching 'wmic'. ([#1110](https://github.com/OmniSharp/omnisharp-vscode/issues/1110), [#1125](https://github.com/OmniSharp/omnisharp-vscode/issues/1125))
35+
* Improvements to the OmniSharp Log ([#1155](https://github.com/OmniSharp/omnisharp-vscode/pull/1155))
36+
* Add new values to the `omnisharp.logginglevel` option to allow more granualar control of OmniSharp logging. ([#993](https://github.com/OmniSharp/omnisharp-vscode/issues/993)) _(Contributed by [@filipw](https://github.com/filipw))_
37+
* Fix `dotnet restore` Visual Studio Code command to handle .csproj .NET Core projects. ([#1175](https://github.com/OmniSharp/omnisharp-vscode/issues/1175))
38+
39+
### Known Issues
40+
41+
* Running and debugging of tests are not supported in .csproj-based .NET Core projects. However, there will still be clickable "run test" and "debug test" indicators above test methods. ([#1100](https://github.com/OmniSharp/omnisharp-vscode/issues/1100))
42+
* Auto-restore for NuGet packages is not yet implemented. If you change a project file and need to restore packages, you should do so by running `dotnet restore` with the .NET CLI. Once packages are restored, you can force the C# extension to "see" the new references by restarting OmniSharp with the `OmniSharp: Restart OmniSharp` command. ([#770](https://github.com/OmniSharp/omnisharp-vscode/issues/770))
43+
* When opening a .csproj-based .NET Core project in VS Code, the C# extension will not activate until a C# file is opened in the editor. ([#1150](https://github.com/OmniSharp/omnisharp-vscode/issues/1150))
44+
145
## 1.6.2 (December 24, 2016)
246

347
* Fix performance issue when editing type names containing multiple generic type parameters. ([#1088](https://github.com/OmniSharp/omnisharp-vscode/issues/1088), [#1086](https://github.com/OmniSharp/omnisharp-vscode/issues/1086))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ See our [change log](https://github.com/OmniSharp/omnisharp-vscode/blob/master/C
3434
* Windows (64-bit only)
3535
* macOS
3636
* Ubuntu 14.04 / Linux Mint 17 / Linux Mint 18 / Elementary OS 0.3
37-
* Ubuntu 16.04 / Elementary OS 0.4 / Arch
37+
* Ubuntu 16.04 / Elementary OS 0.4 / Arch / Zorin OS 12
3838
* Ubuntu 16.10
3939
* Debian 8.2
4040
* CentOS 7.1 / Oracle Linux 7

package.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "csharp",
33
"publisher": "ms-vscode",
4-
"version": "1.7.0-beta1",
4+
"version": "1.7.0-beta3",
55
"description": "C# for Visual Studio Code (powered by OmniSharp).",
66
"displayName": "C#",
77
"author": "Microsoft Corporation",
@@ -66,7 +66,7 @@
6666
"runtimeDependencies": [
6767
{
6868
"description": "Mono Runtime (Linux / x86)",
69-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86-4.6.1.zip",
69+
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86-4.8.0.478.zip",
7070
"installPath": "./bin",
7171
"platforms": [
7272
"linux"
@@ -81,7 +81,7 @@
8181
},
8282
{
8383
"description": "Mono Runtime (Linux / x64)",
84-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86_64-4.6.1.zip",
84+
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86_64-4.8.0.478.zip",
8585
"installPath": "./bin",
8686
"platforms": [
8787
"linux"
@@ -96,7 +96,7 @@
9696
},
9797
{
9898
"description": "Mono Runtime (macOS)",
99-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.osx-4.6.1.zip",
99+
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.osx-4.8.0.478.zip",
100100
"installPath": "./bin",
101101
"platforms": [
102102
"darwin"
@@ -108,7 +108,7 @@
108108
},
109109
{
110110
"description": "Mono Framework Assemblies",
111-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/framework-4.6.1.zip",
111+
"url": "https://omnisharpdownload.blob.core.windows.net/ext/framework-4.8.0.478.zip",
112112
"installPath": "./bin/framework",
113113
"platforms": [
114114
"darwin",
@@ -117,7 +117,7 @@
117117
},
118118
{
119119
"description": "OmniSharp (.NET 4.6 / x86)",
120-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.9-beta22.zip",
120+
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.9-beta24.zip",
121121
"installPath": "./bin/omnisharp",
122122
"platforms": [
123123
"win32"
@@ -128,7 +128,7 @@
128128
},
129129
{
130130
"description": "OmniSharp (.NET 4.6 / x64)",
131-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.9-beta22.zip",
131+
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.9-beta24.zip",
132132
"installPath": "./bin/omnisharp",
133133
"platforms": [
134134
"win32"
@@ -139,7 +139,7 @@
139139
},
140140
{
141141
"description": "OmniSharp (Mono 4.6)",
142-
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.9-beta22.zip",
142+
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.9-beta24.zip",
143143
"installPath": "./bin/omnisharp",
144144
"platforms": [
145145
"darwin",
@@ -356,10 +356,14 @@
356356
},
357357
"omnisharp.loggingLevel": {
358358
"type": "string",
359-
"default": "default",
359+
"default": "information",
360360
"enum": [
361-
"default",
362-
"verbose"
361+
"trace",
362+
"debug",
363+
"information",
364+
"warning",
365+
"error",
366+
"critical"
363367
],
364368
"description": "Specifies the level of logging output from the OmniSharp server."
365369
},
@@ -421,7 +425,7 @@
421425
{
422426
"command": "dotnet.restore",
423427
"title": "Restore Packages",
424-
"category": "dotnet"
428+
"category": ".NET"
425429
},
426430
{
427431
"command": "csharp.downloadDebugger",

src/assets.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class AssetGenerator {
9595
this.hasProject = true;
9696
this.projectPath = path.dirname(targetMSBuildProject.Path);
9797
this.projectFilePath = targetMSBuildProject.Path;
98-
this.targetFramework = findNetCoreAppTargetFramework(targetMSBuildProject).ShortName;
98+
this.targetFramework = protocol.findNetCoreAppTargetFramework(targetMSBuildProject).ShortName;
9999
this.executableName = targetMSBuildProject.AssemblyName + ".dll";
100100
this.configurationName = configurationName;
101101
return;
@@ -284,15 +284,11 @@ export class AssetGenerator {
284284
}
285285
}
286286

287-
function findNetCoreAppTargetFramework(project: protocol.MSBuildProject): protocol.TargetFramework {
288-
return project.TargetFrameworks.find(tf => tf.ShortName.startsWith('netcoreapp'));
289-
}
290-
291287
function findExecutableMSBuildProjects(projects: protocol.MSBuildProject[]) {
292288
let result: protocol.MSBuildProject[] = [];
293289

294290
projects.forEach(project => {
295-
if (project.IsExe && findNetCoreAppTargetFramework(project) !== undefined) {
291+
if (project.IsExe && protocol.findNetCoreAppTargetFramework(project) !== undefined) {
296292
result.push(project);
297293
}
298294
});
@@ -397,7 +393,7 @@ function getBuildOperations(tasksJsonPath: string) {
397393

398394
let buildTasks = getBuildTasks(tasksConfiguration);
399395

400-
resolve({ updateTasksJson: (buildTasks.length > 0) });
396+
resolve({ updateTasksJson: buildTasks.length === 0 });
401397
});
402398
}
403399
else {

src/features/commands.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ interface Command {
8383
execute(): Thenable<any>;
8484
}
8585

86-
function projectsToCommands(projects: protocol.DotNetProject[]): Promise<Command>[] {
86+
function projectsToCommands(projects: protocol.ProjectDescriptor[]): Promise<Command>[] {
8787
return projects.map(project => {
8888
let projectDirectory = project.Path;
8989

@@ -117,11 +117,13 @@ export function dotnetRestoreAllProjects(server: OmniSharpServer) {
117117

118118
return serverUtils.requestWorkspaceInformation(server).then(info => {
119119

120-
if (!info.DotNet || info.DotNet.Projects.length < 1) {
120+
let projectDescriptors = protocol.getDotNetCoreProjectDescriptors(info);
121+
122+
if (projectDescriptors.length === 0) {
121123
return Promise.reject("No .NET Core projects found");
122124
}
123125

124-
let commandPromises = projectsToCommands(info.DotNet.Projects);
126+
let commandPromises = projectsToCommands(projectDescriptors);
125127

126128
return Promise.all(commandPromises).then(commands => {
127129
return vscode.window.showQuickPick(commands);

src/features/processPicker.ts

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import * as os from 'os';
77
import * as vscode from 'vscode';
88
import * as child_process from 'child_process';
9+
import { PlatformInformation } from '../platform';
910

1011
export interface AttachItem extends vscode.QuickPickItem {
1112
id: string;
@@ -389,33 +390,51 @@ function execChildProcess(process: string, workingDirectory: string): Promise<st
389390
});
390391
}
391392

393+
// VSCode cannot find the path "c:\windows\system32\bash.exe" as bash.exe is only available on 64bit OS.
394+
// It can be invoked from "c:\windows\sysnative\bash.exe", so adding "c:\windows\sysnative" to path if we identify
395+
// VSCode is running in windows and doesn't have it in the path.
396+
function GetSysNativePathIfNeeded() : Promise<any> {
397+
return PlatformInformation.GetCurrent().then(platformInfo => {
398+
let env = process.env;
399+
if (platformInfo.isWindows && platformInfo.architecture === "x86_64") {
400+
let sysnative : String = process.env.WINDIR + "\\sysnative";
401+
env.Path = process.env.PATH + ";" + sysnative;
402+
}
403+
404+
return env;
405+
});
406+
}
407+
392408
function execChildProcessAndOutputErrorToChannel(process: string, workingDirectory: string, channel: vscode.OutputChannel): Promise<string> {
393-
channel.appendLine(`Executing: ${process}`);
409+
channel.appendLine(`Executing: ${process}`);
410+
394411
return new Promise<string>((resolve, reject) => {
395-
child_process.exec(process, { cwd: workingDirectory, maxBuffer: 500 * 1024 }, (error: Error, stdout: string, stderr: string) => {
396-
let channelOutput = "";
397-
398-
if (stdout && stdout.length > 0) {
399-
channelOutput.concat(stdout);
400-
}
412+
return GetSysNativePathIfNeeded().then(newEnv => {
413+
child_process.exec(process, { cwd: workingDirectory, env: newEnv, maxBuffer: 500 * 1024 }, (error: Error, stdout: string, stderr: string) => {
414+
let channelOutput = "";
415+
416+
if (stdout && stdout.length > 0) {
417+
channelOutput.concat(stdout);
418+
}
401419

402-
if (stderr && stderr.length > 0) {
403-
channelOutput.concat(stderr);
404-
}
420+
if (stderr && stderr.length > 0) {
421+
channelOutput.concat(stderr);
422+
}
405423

406-
if (error) {
407-
channelOutput.concat(error.message);
408-
}
424+
if (error) {
425+
channelOutput.concat(error.message);
426+
}
409427

410428

411-
if (error || (stderr && stderr.length > 0)) {
412-
channel.append(channelOutput);
413-
channel.show();
414-
reject(new Error("See remote-attach output"));
415-
return;
416-
}
429+
if (error || (stderr && stderr.length > 0)) {
430+
channel.append(channelOutput);
431+
channel.show();
432+
reject(new Error("See remote-attach output"));
433+
return;
434+
}
417435

418-
resolve(stdout);
436+
resolve(stdout);
437+
});
419438
});
420439
});
421440

src/omnisharp/options.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ export class Options {
3333
? csharpConfig.get<boolean>('omnisharpUsesMono')
3434
: omnisharpConfig.get<boolean>('useMono');
3535

36-
const loggingLevel = omnisharpConfig.get<string>('loggingLevel');
36+
// support the legacy "verbose" level as "debug"
37+
let loggingLevel = omnisharpConfig.get<string>('loggingLevel');
38+
if (loggingLevel.toLowerCase() === 'verbose') {
39+
loggingLevel = 'debug';
40+
}
41+
3742
const autoStart = omnisharpConfig.get<boolean>('autoStart', true);
3843

3944
const projectLoadTimeout = omnisharpConfig.get<number>('projectLoadTimeout', 60);

src/omnisharp/protocol.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
'use strict';
77

8+
import * as path from 'path';
9+
810
export module Requests {
911
export const AddToProject = '/addtoproject';
1012
export const AutoComplete = '/autocomplete';
@@ -509,4 +511,38 @@ export namespace V2 {
509511
Failure: string;
510512
Pass: boolean;
511513
}
514+
}
515+
516+
export function findNetCoreAppTargetFramework(project: MSBuildProject): TargetFramework {
517+
return project.TargetFrameworks.find(tf => tf.ShortName.startsWith('netcoreapp'));
518+
}
519+
520+
export function findNetStandardTargetFramework(project: MSBuildProject): TargetFramework {
521+
return project.TargetFrameworks.find(tf => tf.ShortName.startsWith('netstandard'));
522+
}
523+
524+
export interface ProjectDescriptor {
525+
Name: string;
526+
Path: string;
527+
}
528+
529+
export function getDotNetCoreProjectDescriptors(info: WorkspaceInformationResponse): ProjectDescriptor[] {
530+
let result = [];
531+
532+
if (info.DotNet && info.DotNet.Projects.length > 0) {
533+
for (let project of info.DotNet.Projects) {
534+
result.push({ Name: project.Name, Path: project.Path });
535+
}
536+
}
537+
538+
if (info.MsBuild && info.MsBuild.Projects.length > 0) {
539+
for (let project of info.MsBuild.Projects) {
540+
if (findNetCoreAppTargetFramework(project) !== undefined ||
541+
findNetStandardTargetFramework(project) !== undefined) {
542+
result.push({ Name: path.basename(project.Path), Path: project.Path });
543+
}
544+
}
545+
}
546+
547+
return result;
512548
}

0 commit comments

Comments
 (0)