Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Jun 24, 2025

Pulled out of src/RoslynAnalyzers/Microsoft.CodeAnalysis.AnalyzerUtilities/Microsoft.CodeAnalysis.AnalyzerUtilities.csproj

Fix more

Update versions

Fix more

In progress

Flip

Fix

Fix

remove wrapper

Fix

Fix

in progress

Fix DeclarationKind layering

fix

One building

In progress

Breaking out refactoring helpers into core api vs service

VB side

In progress

Move type

workaround

Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems

Fix SubText ctor parameter verification. (dotnet#78989)

* Fix SubText ctor parameter verification.

This ctor currently throws given a zero length span at the end (and only the end) of the subtext. This evidently became far more prevalent with this (fairly) recent change to optimize newline information in our sourcetext classes. (dotnet#74728)

It doesn't make to allow zero length spans at all locations but at the end of the subtext, so the fix is just to allow construction in that case too.

Big props to Manish Vasani for providing a very actionable repro for this.

Fixes dotnet#78985.

Note there is a potentially related issue outlined in dotnet#76225 that looks attributable to the PR above too. It possible that this addresses that issue too, but I'm not completely convinced.

Extensions: bind unconditionally of LangVer (dotnet#78947)

Extensions: use specific tracking issues for different areas (second pass) (dotnet#78971)

Fix nullable analysis involving extensions and collection expressions (dotnet#78926)

Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems

in progrss

Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems

Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems

extensions

Fix

RootNamespace

Fixes

Fixes

IN progress

in progress
…s/Microsoft.CodeAnalysis.Extensions.projitems
@CyrusNajmabadi CyrusNajmabadi requested a review from JoeRobich June 24, 2025 00:52
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review June 24, 2025 00:52
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 24, 2025 00:52
@CyrusNajmabadi
Copy link
Member Author

@JoeRobich ptal

public static readonly SyntaxToken ExplicitKeyword = Token(SyntaxKind.ExplicitKeyword);
#if !ROSLYN_4_12_OR_LOWER
public static readonly SyntaxToken ExtensionKeyword = Token(SyntaxKind.ExtensionKeyword);
#endif
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will be used in RoslynAnalyzers, which will only be able to reference up to Ros 4.12 (we're currently at ros 4.14).

// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments that don't result when this is pulled into libs that don't reference all of the shared side of roslyn workspace.

=> typeSymbol.TryGetPrimaryConstructor(out primaryConstructor);

#if !CODE_STYLE
#if CSHARP_WORKSPACE
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RoslynAnalyzers is also "!CODE_STYLE". so that breaks badly when sharing these files. i didn't feel comfortable defining that constnat for RoslynAnalyzers. So instead, i just flipped these to be either WORKSPACE or !WORKSPACE so that the right semantics are there for the workspace layer vs anyone else.

<InternalsVisibleTo Include="Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\Workspaces\Core\Portable\Formatting\VisualBasic\VisualBasicSyntaxFormattingOptions.cs" Link="Formatting\VisualBasic\VisualBasicSyntaxFormattingOptions.cs" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referencing this now in the shrred lib. not as this weird one-off in a real project.

DiagnosticSeverity.Warning => ReportDiagnostic.Warn,
DiagnosticSeverity.Error => ReportDiagnostic.Error,
_ => throw ExceptionUtilities.UnexpectedValue(diagnosticSeverity),
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to better location.

}

return defaultSeverity.ToReportDiagnostic();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to better location.

<Import Include="Microsoft.CodeAnalysis.VisualBasic" />
<Import Include="Microsoft.CodeAnalysis.VisualBasic.Extensions" />
<Import Include="Roslyn.Utilities" />
<Import Include="Roslyn.Utilities.Contract" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants