Skip to content
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

Need API for enumerating AnalyzerConfigOptions #41840

Closed
JoeRobich opened this issue Feb 20, 2020 · 0 comments · Fixed by #61131
Closed

Need API for enumerating AnalyzerConfigOptions #41840

JoeRobich opened this issue Feb 20, 2020 · 0 comments · Fixed by #61131
Assignees
Labels
api-ready-for-review API is ready for review, it is NOT ready for implementation Area-Compilers Concept-API This issue involves adding, removing, clarification, or modification of an API.
Milestone

Comments

@JoeRobich
Copy link
Member

JoeRobich commented Feb 20, 2020

Since the naming style rules are not tied to a set of known editorconfig options, The NamingStylePreferenceEditorConfigStorageLocation expects to be able to enumerate through the keys of the options to deserialize the preference. The AnalyzerConfigOptions API does not provide a way to perform this enumeration.

My proposal is that we add getter for accessing the Keys as an IEnumerable<string>

public abstract class AnalyzerConfigOptions
{
    ...
    /// <summary>
    /// Enumerates keys of all available options in no specific order.
    /// </summary>
    /// <exception cref="NotImplementedException">Not implemented by the derived type.</exception>
    public virtual IEnumerable<string> Keys
         => throw new NotImplementedException();
    ...
}

The property is virtual to avoid a breaking change.

@tmat tmat added this to the 17.2 milestone Jan 7, 2022
@tmat tmat modified the milestones: 17.2, 17.3 May 5, 2022
@tmat tmat self-assigned this May 5, 2022
@333fred 333fred added Concept-API This issue involves adding, removing, clarification, or modification of an API. api-ready-for-review API is ready for review, it is NOT ready for implementation labels May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-ready-for-review API is ready for review, it is NOT ready for implementation Area-Compilers Concept-API This issue involves adding, removing, clarification, or modification of an API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants