Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Roslyn for Preview 7 #1534

Merged
merged 7 commits into from
Jun 28, 2019
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ All changes to the project will be documented in this file.
}
```
* Fixed a regression on declaration name completion (PR: [#1520](https://github.com/OmniSharp/omnisharp-roslyn/pull/1520))
* Update to Roslyn `3.2.0-beta4-19319-04` (PR: [#1527](https://github.com/OmniSharp/omnisharp-roslyn/pull/1527))
* Update to Roslyn `3.2.0-beta4-19326-12` (PR: [#1534](https://github.com/OmniSharp/omnisharp-roslyn/pull/1534))
* Added snippets support in LSP mode (PR: [#1422](https://github.com/OmniSharp/omnisharp-roslyn/pull/1422))
* Fixed renaming in LSP mode (PR: [#1423](https://github.com/OmniSharp/omnisharp-roslyn/pull/1423))

Expand Down
9 changes: 1 addition & 8 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,7 @@ Task("Build")
{
try
{
if (Platform.Current.IsWindows)
{
BuildWithDotNetCli(env, configuration);
}
else
{
BuildWithMSBuild(env, configuration);
}
BuildWithDotNetCli(env, configuration);
}
catch
{
Expand Down
2 changes: 1 addition & 1 deletion build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<MSBuildPackageVersion>16.0.461</MSBuildPackageVersion>
<NuGetPackageVersion>5.0.0</NuGetPackageVersion>
<RoslynPackageVersion>3.2.0-beta4-19319-04</RoslynPackageVersion>
<RoslynPackageVersion>3.2.0-beta4-19326-12</RoslynPackageVersion>
<XunitPackageVersion>2.4.0</XunitPackageVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ internal static (IOption, OptionStorageLocation, MethodInfo) GetOptionWithStorag
? option.StorageLocations.FirstOrDefault(IsEditorConfigStorage)
: null;

var tryGetOptionMethod = editorConfigStorage?.GetType().GetMethod("TryGetOption");
var tryGetOptionMethod = editorConfigStorage?.GetType().GetMethod("TryGetOption", new[] { typeof(IReadOnlyDictionary<string, string>), typeof(Type), typeof(object).MakeByRefType() });
return (option, editorConfigStorage, tryGetOptionMethod);
}

Expand All @@ -89,10 +89,10 @@ internal static bool TryGetConventionValue((IOption, OptionStorageLocation, Meth
var (option, editorConfigStorage, tryGetOptionMethod) = optionWithStorage;
value = null;

var args = new object[] { option, adjustedConventions, option.Type, value };
var args = new object[] { adjustedConventions, option.Type, value };

var isOptionPresent = (bool)tryGetOptionMethod.Invoke(editorConfigStorage, args);
value = args[3];
value = args[2];

return isOptionPresent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void RenderMethodSymbol(IMethodSymbol methodSymbol)
_sb.Append(arg);
RenderSnippetEndMarker();

if (arg != last)
if (!Equals(arg, last))
{
_sb.Append(", ");
}
Expand Down Expand Up @@ -107,7 +107,7 @@ private void RenderParameters(IMethodSymbol methodSymbol)
_sb.Append(parameter.ToDisplayString(_format));
RenderSnippetEndMarker();

if (parameter != last)
if (!Equals(parameter, last))
{
_sb.Append(", ");
}
Expand All @@ -127,7 +127,7 @@ private IEnumerable<ISymbol> NonInferredTypeArguments(IMethodSymbol methodSymbol
{
var arg = typeArguments[i];
var param = typeParameters[i];
if (arg == param)
if (Equals(arg, param))
{
// this type parameter has not been resolved
nonInferredTypeArguments.Add(arg);
Expand Down
2 changes: 1 addition & 1 deletion src/OmniSharp.Roslyn/Extensions/SymbolExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ internal static INamedTypeSymbol GetTopLevelContainingNamedType(this ISymbol sym
{
// Traverse up until we find a named type that is parented by the namespace
var topLevelNamedType = symbol;
while (topLevelNamedType.ContainingSymbol != symbol.ContainingNamespace ||
while (!Equals(topLevelNamedType.ContainingSymbol, symbol.ContainingNamespace) ||
topLevelNamedType.Kind != SymbolKind.NamedType)
{
topLevelNamedType = topLevelNamedType.ContainingSymbol;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics

public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
context.EnableConcurrentExecution();
context.RegisterSymbolAction(AnalyzeSymbol, SymbolKind.NamedType);
}

Expand Down