Merge pull request #1598 from OmniSharp/master
Merge master into release
This commit is contained in:
Коммит
58c234ddd3
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -4,6 +4,17 @@
|
|||
* There currently is no completion support for package references in csproj files. ([#1156](https://github.com/OmniSharp/omnisharp-vscode/issues/1156))
|
||||
* .NET Core SDK 2.0-preview2 is not yet supported. ([#1495](https://github.com/OmniSharp/omnisharp-vscode/issues/1495))
|
||||
|
||||
## 1.11.0 _(Not Yet Released)_
|
||||
|
||||
#### Completion List
|
||||
|
||||
* No longer trigger completion when a '<' character is typed. ([#1521](https://github.com/OmniSharp/omnisharp-vscode/issues/1521), PR: [#1530](https://github.com/OmniSharp/omnisharp-vscode/pull/1530))
|
||||
* Completion list no longer triggers on space in contexts where a lambda expression could be typed. ([#1524](https://github.com/OmniSharp/omnisharp-vscode/issues/1524), PR: [#1548](https://github.com/OmniSharp/omnisharp-vscode/pull/1548))
|
||||
|
||||
#### Other Updates and Fixes
|
||||
|
||||
* Allow the ".NET: Restore Packages" command to run on projects targeting full framework. ([#1507](https://github.com/OmniSharp/omnisharp-vscode/pull/1507), PR: [#1545](https://github.com/OmniSharp/omnisharp-vscode/pull/1545)) _(contributed by [@adamhartford](https://github.com/adamhartford))_
|
||||
|
||||
## 1.10.0 (May 25, 2017)
|
||||
|
||||
#### Completion List
|
||||
|
@ -40,6 +51,7 @@
|
|||
* Added `csharp.unitTestDebugingOptions` setting to pass launch.json-style debug options (example: `justMyCode`) when unit test debugging.
|
||||
|
||||
#### Debugger
|
||||
|
||||
* Resolves crash on OSX when the target process loads an embedded PDB ([#1456](https://github.com/OmniSharp/omnisharp-vscode/issues/1456)). This commonly affects users trying to debug XUnit tests.
|
||||
* Enhanced exception peek display to provide additional exception properties.
|
||||
|
||||
|
|
35
package.json
35
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "csharp",
|
||||
"publisher": "ms-vscode",
|
||||
"version": "1.10.0",
|
||||
"version": "1.11.0-beta4",
|
||||
"description": "C# for Visual Studio Code (powered by OmniSharp).",
|
||||
"displayName": "C#",
|
||||
"author": "Microsoft Corporation",
|
||||
|
@ -68,7 +68,8 @@
|
|||
"runtimeDependencies": [
|
||||
{
|
||||
"description": "Mono Runtime (Linux / x86)",
|
||||
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86-4.8.0.478.zip",
|
||||
"url": "https://omnisharpdownload.azureedge.net/ext/mono.linux-x86-5.2.0-omnisharp1.zip",
|
||||
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86-5.2.0-omnisharp1.zip",
|
||||
"installPath": "./bin",
|
||||
"platforms": [
|
||||
"linux"
|
||||
|
@ -84,7 +85,8 @@
|
|||
},
|
||||
{
|
||||
"description": "Mono Runtime (Linux / x64)",
|
||||
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86_64-4.8.0.478.zip",
|
||||
"url": "https://omnisharpdownload.azureedge.net/ext/mono.linux-x86_64-5.2.0-omnisharp1.zip",
|
||||
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/mono.linux-x86_64-5.2.0-omnisharp1.zip",
|
||||
"installPath": "./bin",
|
||||
"platforms": [
|
||||
"linux"
|
||||
|
@ -100,7 +102,8 @@
|
|||
},
|
||||
{
|
||||
"description": "Mono Runtime (macOS)",
|
||||
"url": "https://omnisharpdownload.blob.core.windows.net/ext/mono.osx-4.8.0.478.zip",
|
||||
"url": "https://omnisharpdownload.azureedge.net/ext/mono.osx-5.2.0-omnisharp1.zip",
|
||||
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/mono.osx-5.2.0-omnisharp1.zip",
|
||||
"installPath": "./bin",
|
||||
"platforms": [
|
||||
"darwin"
|
||||
|
@ -113,7 +116,8 @@
|
|||
},
|
||||
{
|
||||
"description": "Mono Framework Assemblies",
|
||||
"url": "https://omnisharpdownload.blob.core.windows.net/ext/framework-4.8.0.478.zip",
|
||||
"url": "https://omnisharpdownload.azureedge.net/ext/framework-5.2.0-omnisharp1.zip",
|
||||
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/framework-5.2.0-omnisharp1.zip",
|
||||
"installPath": "./bin/framework",
|
||||
"platforms": [
|
||||
"darwin",
|
||||
|
@ -123,7 +127,8 @@
|
|||
},
|
||||
{
|
||||
"description": "OmniSharp (.NET 4.6 / x86)",
|
||||
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.19.1.zip",
|
||||
"url": "https://omnisharpdownload.azureedge.net/ext/omnisharp-win-x86-1.21.0.zip",
|
||||
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.21.0.zip",
|
||||
"installPath": "./bin/omnisharp",
|
||||
"platforms": [
|
||||
"win32"
|
||||
|
@ -135,7 +140,8 @@
|
|||
},
|
||||
{
|
||||
"description": "OmniSharp (.NET 4.6 / x64)",
|
||||
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.19.1.zip",
|
||||
"url": "https://omnisharpdownload.azureedge.net/ext/omnisharp-win-x64-1.21.0.zip",
|
||||
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.21.0.zip",
|
||||
"installPath": "./bin/omnisharp",
|
||||
"platforms": [
|
||||
"win32"
|
||||
|
@ -147,7 +153,8 @@
|
|||
},
|
||||
{
|
||||
"description": "OmniSharp (Mono 4.6)",
|
||||
"url": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.19.1.zip",
|
||||
"url": "https://omnisharpdownload.azureedge.net/ext/omnisharp-mono-1.21.0.zip",
|
||||
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-mono-1.21.0.zip",
|
||||
"installPath": "./bin/omnisharp",
|
||||
"platforms": [
|
||||
"darwin",
|
||||
|
@ -360,7 +367,7 @@
|
|||
],
|
||||
"description": "If the current Linux distribution is not recognized, this option can be used to tell the debugger what version can be used. After changing this option, close VS Code, remove the debugger folder (~/.vscode/extensions/ms-vscode.csharp-<ver>/.debugger) if it has already downloaded, and restart VS Code."
|
||||
},
|
||||
"csharp.unitTestDebugingOptions": {
|
||||
"csharp.unitTestDebuggingOptions": {
|
||||
"type": "object",
|
||||
"description": "Options to use with the debugger when launching for unit test debugging. Any launch.json option is valid here.",
|
||||
"default": {},
|
||||
|
@ -401,7 +408,7 @@
|
|||
"debugServer": {
|
||||
"type": "number",
|
||||
"description": "For debug extension development only: if a port is specified VS Code tries to connect to a debug adapter running in server mode",
|
||||
"default": 4711
|
||||
"default": 4711
|
||||
},
|
||||
"logging": {
|
||||
"description": "Optional flags to determine what types of messages should be logged to the output window.",
|
||||
|
@ -444,9 +451,9 @@
|
|||
"description": "Suppress the notification window to perform a 'dotnet restore' when dependencies can't be resolved."
|
||||
},
|
||||
"csharp.suppressHiddenDiagnostics": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Suppress 'hidden' diagnostics (such as 'unnecessary using directives') from appearing in the editor or the Problems pane."
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Suppress 'hidden' diagnostics (such as 'unnecessary using directives') from appearing in the editor or the Problems pane."
|
||||
},
|
||||
"omnisharp.path": {
|
||||
"type": [
|
||||
|
@ -2271,4 +2278,4 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,10 +15,15 @@ import {CompletionItemProvider, CompletionItem, CompletionItemKind, Cancellation
|
|||
export default class OmniSharpCompletionItemProvider extends AbstractSupport implements CompletionItemProvider {
|
||||
|
||||
// copied from Roslyn here: https://github.com/dotnet/roslyn/blob/6e8f6d600b6c4bc0b92bc3d782a9e0b07e1c9f8e/src/Features/Core/Portable/Completion/CompletionRules.cs#L166-L169
|
||||
private static DefaultCommitCharacters = [
|
||||
private static AllCommitCharacters = [
|
||||
' ', '{', '}', '[', ']', '(', ')', '.', ',', ':',
|
||||
';', '+', '-', '*', '/', '%', '&', '|', '^', '!',
|
||||
'~', '=', '<', '>', '?', '@', '#', '\'', '\"', '\\'];
|
||||
|
||||
private static CommitCharactersWithoutSpace = [
|
||||
'{', '}', '[', ']', '(', ')', '.', ',', ':',
|
||||
';', '+', '-', '*', '/', '%', '&', '|', '^', '!',
|
||||
'~', '=', '<', '>', '?', '@', '#', '\'', '\"', '\\'];
|
||||
|
||||
public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Promise<CompletionItem[]> {
|
||||
|
||||
|
@ -55,7 +60,10 @@ export default class OmniSharpCompletionItemProvider extends AbstractSupport imp
|
|||
completion.documentation = extractSummaryText(response.Description);
|
||||
completion.kind = _kinds[response.Kind] || CompletionItemKind.Property;
|
||||
completion.insertText = response.CompletionText.replace(/<>/g, '');
|
||||
completion.commitCharacters = OmniSharpCompletionItemProvider.DefaultCommitCharacters;
|
||||
|
||||
completion.commitCharacters = response.IsSuggestionMode
|
||||
? OmniSharpCompletionItemProvider.CommitCharactersWithoutSpace
|
||||
: OmniSharpCompletionItemProvider.AllCommitCharacters;
|
||||
|
||||
let array = completions[completion.label];
|
||||
if (!array) {
|
||||
|
|
|
@ -100,7 +100,7 @@ export function runDotnetTest(testMethod: string, fileName: string, testFramewor
|
|||
}
|
||||
|
||||
function createLaunchConfiguration(program: string, args: string, cwd: string, debuggerEventsPipeName: string) {
|
||||
let debugOptions = vscode.workspace.getConfiguration('csharp').get('unitTestDebugingOptions');
|
||||
let debugOptions = vscode.workspace.getConfiguration('csharp').get('unitTestDebuggingOptions');
|
||||
|
||||
// Get the initial set of options from the workspace setting
|
||||
let result: any;
|
||||
|
|
|
@ -57,7 +57,7 @@ export function activate(context: vscode.ExtensionContext, reporter: TelemetryRe
|
|||
localDisposables.push(vscode.languages.registerRenameProvider(documentSelector, new RenameProvider(server)));
|
||||
localDisposables.push(vscode.languages.registerDocumentRangeFormattingEditProvider(documentSelector, new FormatProvider(server)));
|
||||
localDisposables.push(vscode.languages.registerOnTypeFormattingEditProvider(documentSelector, new FormatProvider(server), '}', ';'));
|
||||
localDisposables.push(vscode.languages.registerCompletionItemProvider(documentSelector, new CompletionItemProvider(server), '.', '<'));
|
||||
localDisposables.push(vscode.languages.registerCompletionItemProvider(documentSelector, new CompletionItemProvider(server), '.'));
|
||||
localDisposables.push(vscode.languages.registerWorkspaceSymbolProvider(new WorkspaceSymbolProvider(server)));
|
||||
localDisposables.push(vscode.languages.registerSignatureHelpProvider(documentSelector, new SignatureHelpProvider(server), '(', ','));
|
||||
const codeActionProvider = new CodeActionProvider(server);
|
||||
|
|
|
@ -267,6 +267,7 @@ export interface AutoCompleteResponse {
|
|||
ReturnType: string;
|
||||
Snippet: string;
|
||||
Kind: string;
|
||||
IsSuggestionMode: boolean;
|
||||
}
|
||||
|
||||
export interface ProjectInformationResponse {
|
||||
|
@ -565,6 +566,11 @@ export namespace V2 {
|
|||
}
|
||||
}
|
||||
|
||||
export function findNetFrameworkTargetFramework(project: MSBuildProject): TargetFramework {
|
||||
let regexp = new RegExp('^net[1-4]');
|
||||
return project.TargetFrameworks.find(tf => regexp.test(tf.ShortName));
|
||||
}
|
||||
|
||||
export function findNetCoreAppTargetFramework(project: MSBuildProject): TargetFramework {
|
||||
return project.TargetFrameworks.find(tf => tf.ShortName.startsWith('netcoreapp'));
|
||||
}
|
||||
|
@ -573,6 +579,12 @@ export function findNetStandardTargetFramework(project: MSBuildProject): TargetF
|
|||
return project.TargetFrameworks.find(tf => tf.ShortName.startsWith('netstandard'));
|
||||
}
|
||||
|
||||
export function isDotNetCoreProject(project: MSBuildProject): Boolean {
|
||||
return findNetCoreAppTargetFramework(project) !== undefined ||
|
||||
findNetStandardTargetFramework(project) !== undefined ||
|
||||
findNetFrameworkTargetFramework(project) !== undefined;
|
||||
}
|
||||
|
||||
export interface ProjectDescriptor {
|
||||
Name: string;
|
||||
Directory: string;
|
||||
|
@ -594,8 +606,7 @@ export function getDotNetCoreProjectDescriptors(info: WorkspaceInformationRespon
|
|||
|
||||
if (info.MsBuild && info.MsBuild.Projects.length > 0) {
|
||||
for (let project of info.MsBuild.Projects) {
|
||||
if (findNetCoreAppTargetFramework(project) !== undefined ||
|
||||
findNetStandardTargetFramework(project) !== undefined) {
|
||||
if (isDotNetCoreProject(project)) {
|
||||
result.push({
|
||||
Name: path.basename(project.Path),
|
||||
Directory: path.dirname(project.Path),
|
||||
|
|
|
@ -3,14 +3,14 @@ OptionsSchema.json defines the type for Launch/Attach options.
|
|||
|
||||
# GenerateOptionsSchema
|
||||
If there are any modifications to the OptionsSchema.json file. Please run `gulp generateOptionsSchema` at the repo root.
|
||||
This will call GenerateOptionsSchema and update the package.json file.
|
||||
This will call GenerateOptionsSchema and update the package.json file.
|
||||
|
||||
### Important notes:
|
||||
|
||||
1. Any manual changes to package.json's object.contributes.debuggers[0].configurationAttributes will be
|
||||
1. Any manual changes to package.json's object.contributes.debuggers[0].configurationAttributes will be
|
||||
replaced by this generator.
|
||||
2. This does **NOT** update the schema for csharp.unitTestDebugingOptions. So if the schema change is something valuable in unit test debugging, consider updating that section of package.json (look for `"csharp.unitTestDebugingOptions"`). The schema will work even if this step is omitted, but users will not get IntelliSense help when editing the new option if this step is skipped.
|
||||
2. This does **NOT** update the schema for csharp.unitTestDebuggingOptions. So if the schema change is something valuable in unit test debugging, consider updating that section of package.json (look for `"csharp.unitTestDebuggingOptions"`). The schema will work even if this step is omitted, but users will not get IntelliSense help when editing the new option if this step is skipped.
|
||||
|
||||
|
||||
If there is any other type of options added in the future, you will need to modify the GenerateOptionsSchema function
|
||||
If there is any other type of options added in the future, you will need to modify the GenerateOptionsSchema function
|
||||
to have it appear in package.json. It only adds launch and attach.
|
||||
|
|
Загрузка…
Ссылка в новой задаче