Skip to content

Commit

Permalink
Fix #90 round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekkonnect committed Dec 25, 2024
1 parent 891f0b7 commit 5f85138
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public abstract AnalysisTreeListNode CreateRootNodeList<TDisplayValueSource>(
;

public abstract AnalysisTreeListNode CreateRootTokenList<TDisplayValueSource>(
SyntaxTokenList list, TDisplayValueSource? valueSource, bool includeChildren = true)
IReadOnlyList<SyntaxToken> list, TDisplayValueSource? valueSource, bool includeChildren = true)
where TDisplayValueSource : IDisplayValueSource
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Linq;

namespace Syndiesis.Core.DisplayAnalysis;
Expand All @@ -20,6 +21,7 @@ namespace Syndiesis.Core.DisplayAnalysis;
using ComplexGroupedRunInline = ComplexGroupedRunInline.Builder;

using ReadOnlySyntaxNodeList = IReadOnlyList<SyntaxNode>;
using SyntaxTokenList = IReadOnlyList<SyntaxToken>;

public sealed partial class CSharpSyntaxAnalysisNodeCreator : BaseSyntaxAnalysisNodeCreator
{
Expand Down Expand Up @@ -947,9 +949,7 @@ private static string EndOfLineTriviaText(SyntaxTrivia trivia)

private static string DisabledTextTriviaText(SyntaxTrivia trivia)
{
// https://github.com/dotnet/roslyn/issues/76441
if (trivia.SyntaxTree is null)
return "[Unknown line bounds]";
Contract.Assert(trivia.SyntaxTree is not null);

var span = trivia.Span;
var lineSpan = trivia.SyntaxTree.GetLineSpan(span).Span;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Diagnostics;
using System.Linq;
using Garyon.Reflection;
using System.Diagnostics.Contracts;

namespace Syndiesis.Core.DisplayAnalysis;

Expand All @@ -20,6 +21,7 @@ namespace Syndiesis.Core.DisplayAnalysis;
using ComplexGroupedRunInline = ComplexGroupedRunInline.Builder;

using ReadOnlySyntaxNodeList = IReadOnlyList<SyntaxNode>;
using SyntaxTokenList = IReadOnlyList<SyntaxToken>;

public sealed partial class VisualBasicSyntaxAnalysisNodeCreator : BaseSyntaxAnalysisNodeCreator
{
Expand Down Expand Up @@ -953,9 +955,7 @@ private static string EndOfLineTriviaText(SyntaxTrivia trivia)

private static string DisabledTextTriviaText(SyntaxTrivia trivia)
{
// https://github.com/dotnet/roslyn/issues/76441
if (trivia.SyntaxTree is null)
return "[Unknown line bounds]";
Contract.Assert(trivia.SyntaxTree is not null);

var span = trivia.Span;
var lineSpan = trivia.SyntaxTree.GetLineSpan(span).Span;
Expand Down
2 changes: 1 addition & 1 deletion Syndiesis/Core/NodeViewAnalysisExecution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private static ComplexDisplayValueSource ConstructSemanticModelValueSource(
return null;
return
_container.SyntaxCreator.CreateRootTokenList(
new SyntaxTokenList(_node?.ChildTokens() ?? []),
_node?.ChildTokens().ToList() ?? [],
_childTokensValueSource);
}

Expand Down

0 comments on commit 5f85138

Please sign in to comment.