Skip to content

Options master plan #58717

@tmat

Description

@tmat

Work items:

  • Finish Separate global options and solution options #55728
  • Eliminate editorconfig options mapping (TryMapEditorConfigKeyToOption)
    • Moved to IEditorConfigOptionMappingService
    • May be possible to hardcode public options, we shouldn't need mapping for other
  • Move IGlobalOptionService to LSP layer, later on to EditorFeatures once solution crawler is removed
    Currently also used by LSP server to read Pull/Push diagnostics option.
    Remove InlineHintsOptions.DisplayAllOverride #57283
  • Internally obsolete/remove:
    • OptionSet,
    • DocumentOptionSet,
    • SerializableOptionSet - replaced with SolutionOptionSet
    • WorkspaceOptionSet,
    • AnalyzerConfigOptionSet
  • Remove IDocumentOptionsProvider,
    Remove RazorDocumentOptionsProvider. Razor only uses this to override indentation options. These should flow via LSP/EditorOptions.
    Refactor InferredIndentationDocumentOptionsProviderFactory to avoid IDocumentOptionsProvider. These should be just flow from EditorOptions.
  • Remove IOptionService (replaced with ILegacyWorkspaceOptionService)
  • Obsolete Document.GetOptionsAsync
  • Obsolete Solution.Options and Workspace.Options
    Services that currently read Solution options should be passed their options explicitly using specific option record (as described in Separate global options and solution options #55728).
    The source of these options would be either IGlobalOptionService service accessed in client code in EditorFeatures layer or above, or LSP server who receives the options from the LSP client.
    Note: Need to serialize values for options read from editorconfig.
    • AddImportOptions
    • CodeActionOptions
    • FadingOptions
    • FormattingOptionsMetadata
    • CompletionOptions
    • DiagnosticOptions
    • DocumentationCommentOptions
    • RegularExpressionsOptions
    • ExtractMethodOptions
    • GenerateOverridesOptions
    • ImplementTypeOptions
    • InlineParameterHintsOptions
    • InlineTypeHintsOptions
    • NavigationOptionsProvider
    • QuickInfoOptions
    • BlockStructureOptions
    • ValidateFormatStringOptionProvider
    • ClassificationOptions
    • CodeStyleOptionsProvider
    • GenerationOptionsProvider
    • PythiaOptions
    • AutoFormattingOptions
    • SimplificationOptionProvider
    • SolutionCrawlerOnOffOptionsProvider
    • StorageOptions
    • SymbolSearchOptions
    • TodoCommentOptions
    • FormattingOptions2
    • SyntaxTreeConfigurationOptions
    • VisualStudioSyntaxTreeConfigurationService
    • GenerateEqualsAndGetHashCodeFromMembersOptions
  • Public options:
    The corresponding APIs need to load these from Solution.Options for backward compat. These will not be available OOP.
    • CSharpFormattingOptions
    • RenameOptions
    • SimplificationOptions
    • CodeStyleOptions
  • Remove IOptionProvider, ExportOption attributes
    All options should be global options or .editorconfig options. SolutionExportOptionAttirbute is only needed for serialization to SerializableOptionSet. GlobalExportOptionAttribute is not needed.
  • Analyzers will read their settings from AnalyzerConfigOptions
    Remove AnalyzerConfigOptionsImpl, which combines AnalyzerConfigOptions with OptionSet. Instead, represent .editorconfig option values that are stored in VS registry settings and used as defaults when no .editorconfig applies as AnalyzerConfigOptions implementing a global .editorconfig. This instance of AnalyzerConfigOptions can be stored in on WorkspaceAnalyzerOptions and trivially serializable.

Editor/Platform prerequisites:

  • Make IVsTextView.IndentStyle available through ITextView.Options: VS #1412138
  • Custom editorconfig properties are not exposed through editor options: VS #1429383
  • Editorconfig options in the editor do not have lowercased keys and the dictionary is not case-insensitive VS #1556206
  • Add free-threaded API that replaces IVsTextManager4.GetUserPreferences4: VS #1307188
  • LSP options design and implementation

Related:

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions