Closed mavasani closed 2 weeks ago
Tag @tmat @sharwell @jasonmalinowski - let me know if I forgot any other follow-up cleanup items that we came up with in the meeting.
@sharwell @CyrusNajmabadi can we bring this to Monday's design meeting to review specifically the last item?
Revert
#if CODE_STYLE
directives added to product source and tests due for the scenario where certain new Nullability APIs are not yet available in CodeStyle layer. This might mean either moving the CodeStyle layer to new Microsoft.CodeAnalysis API OR adding reflection based lightup support in CodeStyle layer.
It should hopefully be a quick discussion and would bring back bunch of missing functionality in CodeStyle layer.
Marking for next meeting - we need to really decide if we are going to use lightup/reflection in CodeStyle layer or become lenient in moving CodeStyle layer to newer Microsoft.CodeAnalysis to be able to access newly added APIs.
Closing out as we haven't done anything with this in 4 years.
During the design meeting discussion on https://github.com/dotnet/roslyn/pull/41363, we decided to go ahead with the current approach in the PR with the following follow-up items:
Microsoft.CodeAnalysis.Testing
:AnalyzerConfigOptions
instead ofOptionSet
. This involves adding support for creating and passing a fallback .editorconfig/AnalyzerConfigOptions from Tools Options settings into analysis context.GetDocumentOptionSetAsync
API in the shared layer, which is currently used to get fallback Workspace options. Likely the work in prior bullet item will automatically take care of this, but adding an explicit cleanup item here so we validate that.#if CODE_STYLE
from the shared projects. All of them should be possible to remove trivially, except the ones related to public Options related types (OptionSet, IOption, CodeStyleOption, CodeStyleOptions, NotificationOptions, etc.), which are public APIs in Workspaces layer but also need by the CodeStyle analyzers which do not have access to Workspaces.CodeAction.DocumentChangeAction
is used in IDE code fixes, and was replaced with a new typeCustomCodeActions
in shared layer. Do we want to get rid of the CustomCodeActions types completely? Do we want to avoid them just in CodeStyle layer but still use them for analyzers linked into Features? Latter will introduce#if CODE_STYLE
clutter in each code fix file, which seems undesirable.SytnaxEditorBasedCodeFixProvider.IncludeDiagnosticDuringFixAll
as per https://github.com/dotnet/roslyn/pull/41510#discussion_r377391657AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.IsRegularCommentOrDocComment
and directly call into syntax facts service once it is available in shared analyzer layer.IGeneratedCodeRecognitionService.IsGeneratedCode
and moving all existing callers toIGeneratedCodeRecognitionService.IsGeneratedCodeAsync
SyntaxGenerator.GetGenerator(document)
versusdocument.GetRequiredLanguageService<SyntaxGenerator>()
in our code base.#if CODE_STYLE
directives added to product source and tests due for the scenario where certain new Nullability APIs are not yet available in CodeStyle layer. This might mean either moving the CodeStyle layer to new Microsoft.CodeAnalysis API OR adding reflection based lightup support in CodeStyle layer.#if CODE_STYLE
directives related toITypeSymbol.IsNativeIntegerType
(not yet available in CodeStyle layer). See PR https://github.com/dotnet/roslyn/issues/41462ISemanticFactsService
to shared CompilerExtensions project so they can be used in our analyzers in the shared layer. See https://github.com/dotnet/roslyn/pull/42264#discussion_r390999980OptionSet
inEditorConfigStorageLocation2
to allow null values. See https://github.com/dotnet/roslyn/pull/42323#discussion_r392730378IOptionsCollection
instead ofIDictionary<OptionKey, object
. See https://github.com/dotnet/roslyn/pull/42323#discussion_r395386979