-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Follow up items after PR 41363 #41462
Comments
Tag @tmat @sharwell @jasonmalinowski - let me know if I forgot any other follow-up cleanup items that we came up with in the meeting. |
Extracted from dotnet#41363 Third follow-up item from dotnet#41462 Apart from adding resx files, changes also include: 1. Moving resource strings duplicated across Workspaces and CodeStyle layer into the shared resx files 2. Source file changes to use the resource strings from the shared resx. We should no longer require use of `#if CODE_STYLE` in the shared layer for the purpose of resource strings.
Extracted out of dotnet#41363 so it only contains the following changes: 1. Port analyzer/fixer/test files for ConvertSwitchStatementToExpression to shared layer 2. Options related namespace changes (see comment dotnet#41363 (comment) for details) 3. MEF based language service discovery in CodeStyle layer. dotnet#41462 tracks replacing this with a non-MEF based approach. 4. Minimal resx/xlf file changes - few were needed as the resources used by analyzer/fixer were moved to shared resx file. 5. Enable .editorconfig based unit test support for CodeStyle layer. NOTE: First commit dotnet@b006324 just ports changes from dotnet#40513 which are required to enable this support. This commit should become redundant once that PR is merged in.
This unblocks porting analyzers to CodeStyle layer. dotnet#41462 tracks replacing this with a non-MEF based approach.
This unblocks porting analyzers to CodeStyle layer. dotnet#41462 tracks replacing this with a non-MEF based approach.
@sharwell @CyrusNajmabadi can we bring this to Monday's design meeting to review specifically the last item?
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 #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 Refactor extensions and utilities in Workspaces layer into shared pro… #41510 (comment)AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.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 Follow up items after PR 41363 #41462ISemanticFactsService
to shared CompilerExtensions project so they can be used in our analyzers in the shared layer. See Port UseThrowExpression analyzer/fixer to shared layer #42264 (comment)OptionSet
inEditorConfigStorageLocation2
to allow null values. See Move Options and CodeStyle APIs to shared layer #42323 (comment)IOptionsCollection
instead ofIDictionary<OptionKey, object
. See Move Options and CodeStyle APIs to shared layer #42323 (comment)The text was updated successfully, but these errors were encountered: