-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Precursor to share code with RoslynAnalyzers. #79117
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
Precursor to share code with RoslynAnalyzers. #79117
Conversation
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
...SharedUtilitiesAndExtensions/Compiler/Extensions/Microsoft.CodeAnalysis.Extensions.projitems
Outdated
Show resolved
Hide resolved
…s/Microsoft.CodeAnalysis.Extensions.projitems
|
@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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
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), | ||
| }; |
There was a problem hiding this comment.
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(); | ||
| } |
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed.
Pulled out of src/RoslynAnalyzers/Microsoft.CodeAnalysis.AnalyzerUtilities/Microsoft.CodeAnalysis.AnalyzerUtilities.csproj