Skip to content

Commit

Permalink
Update Roslyn to 4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Dec 5, 2024
1 parent 2350e2c commit e62233e
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DnSpyCommon.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<MSVSTextVersion>15.5.27130</MSVSTextVersion>
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<OokiiDialogsWpfVersion>5.0.1</OokiiDialogsWpfVersion>
<RoslynVersion>4.11.0</RoslynVersion>
<RoslynVersion>4.12.0</RoslynVersion>
<SCCompositionVersion>9.0.0</SCCompositionVersion>
<NuGetVersion>6.12.1</NuGetVersion>
<DbgShimVersion>9.0.553101</DbgShimVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void Dispose() { }
NewLine = _textView.Options.GetNewLineCharacter()
};

var indentationOptions = new IndentationOptions(SyntaxFormattingOptions.GetDefault(document.Project.Services) with { LineFormatting = lineFormattingOptions });
var indentationOptions = new IndentationOptions(SyntaxFormattingOptions.CommonDefaults with { LineFormatting = lineFormattingOptions });
var parsedDocument = ParsedDocument.CreateSynchronously(document, cancellationToken);
var result = newService.GetIndentation(parsedDocument, line.LineNumber, indentationOptions, cancellationToken);
return result.GetIndentation(_textView, line);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected async Task<QuickInfoContent> CreateContentAsync(HostWorkspaceServices
var symbols = tokenInformation.Symbols;

// if generating quick info for an attribute, prefer bind to the class instead of the constructor
if (syntaxFactsService.IsAttributeName(token.Parent!)) {
if (syntaxFactsService.IsNameOfAttribute(token.Parent!)) {
symbols = symbols.OrderBy((s1, s2) =>
s1.Kind == s2.Kind ? 0 :
s1.Kind == SymbolKind.NamedType ? -1 :
Expand Down Expand Up @@ -346,7 +346,7 @@ private ImmutableArray<TaggedText> GetDocumentationContent(IEnumerable<ISymbol>
var symbol = symbols.First().OriginalDefinition;

// if generating quick info for an attribute, bind to the class instead of the constructor
if (syntaxFactsService.IsAttributeName(token.Parent) &&
if (syntaxFactsService.IsNameOfAttribute(token.Parent) &&
symbol.ContainingType?.IsAttribute() == true) {
symbol = symbol.ContainingType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public SignatureHelpItems(SIGHLP.SignatureHelpItems signatureHelpItems) {
if (signatureHelpItems == null)
throw new ArgumentNullException(nameof(signatureHelpItems));
ApplicableSpan = signatureHelpItems.ApplicableSpan;
ArgumentCount = signatureHelpItems.ArgumentCount;
ArgumentIndex = signatureHelpItems.ArgumentIndex;
ArgumentCount = signatureHelpItems.SyntacticArgumentCount;
ArgumentIndex = signatureHelpItems.SemanticParameterIndex;
ArgumentName = signatureHelpItems.ArgumentName;
SelectedItemIndex = signatureHelpItems.SelectedItemIndex;
Items = ToSignatureHelpItem(signatureHelpItems.Items);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ partial class SignatureHelpService {
ISignatureHelpProvider[] providers,
int caretPosition,
SIGHLP.SignatureHelpTriggerInfo triggerInfo,
SignatureHelpOptions options,
MemberDisplayOptions options,
Document document,
CancellationToken cancellationToken) {
ISignatureHelpProvider bestProvider = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static SignatureHelpService GetService(Document document) {
}

public async Task<SignatureHelpResult> GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, CancellationToken cancellationToken = default(CancellationToken)) {
var res = await ComputeItemsAsync(signatureHelpProviders, position, triggerInfo.ToSignatureHelpTriggerInfo(), SignatureHelpOptions.Default, document, cancellationToken).ConfigureAwait(false);
var res = await ComputeItemsAsync(signatureHelpProviders, position, triggerInfo.ToSignatureHelpTriggerInfo(), MemberDisplayOptions.Default, document, cancellationToken).ConfigureAwait(false);
return GetSignatureHelpResult(res, document);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ readonly record struct IndentationOptions([property: DataMember(Order = 0)] Synt

public const FormattingOptions2.IndentStyle DefaultIndentStyle = FormattingOptions2.IndentStyle.Smart;

public static IndentationOptions GetDefault(LanguageServices languageServices) =>
new IndentationOptions(SyntaxFormattingOptions.GetDefault(languageServices));
}
}
26 changes: 13 additions & 13 deletions dnSpy/dnSpy/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -58,55 +58,55 @@

<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Features" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Workspaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.Features" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.VisualBasic" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.VisualBasic.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.VisualBasic.Features" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.Workspaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.Workspaces.Desktop" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-4.11.0.0" newVersion="4.11.0.0" />
<bindingRedirect oldVersion="1.0.0.0-4.12.0.0" newVersion="4.12.0.0" />
</dependentAssembly>

<dependentAssembly>
Expand Down

0 comments on commit e62233e

Please sign in to comment.