-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
275 additions
and
285 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/EditorFeatures/Core/Implementation/Classification/ClassificationOptionsMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CodeAnalysis.Options; | ||
|
||
namespace Microsoft.CodeAnalysis.Classification | ||
{ | ||
internal static class ClassificationOptionsMetadata | ||
{ | ||
public static ClassificationOptions GetClassificationOptions(this IGlobalOptionService globalOptions, string language) | ||
=> new( | ||
ClassifyReassignedVariables: globalOptions.GetOption(ClassifyReassignedVariables, language), | ||
ColorizeRegexPatterns: globalOptions.GetOption(ColorizeRegexPatterns, language)); | ||
|
||
public static PerLanguageOption2<bool> ClassifyReassignedVariables => ClassificationOptions.Metadata.ClassifyReassignedVariables; | ||
public static PerLanguageOption2<bool> ColorizeRegexPatterns => ClassificationOptions.Metadata.ColorizeRegexPatterns; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
src/EditorFeatures/Core/InlineHints/InlineHintsOptionsMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CodeAnalysis.LanguageServices; | ||
using Microsoft.CodeAnalysis.Options; | ||
|
||
namespace Microsoft.CodeAnalysis.InlineHints | ||
{ | ||
internal static class InlineHintsOptionsMetadata | ||
{ | ||
public static InlineHintsOptions GetInlineHintsOptions(this IGlobalOptionService globalOptions, string language) | ||
=> new( | ||
ParameterOptions: globalOptions.GetInlineParameterHintsOptions(language), | ||
TypeOptions: globalOptions.GetInlineTypeHintsOptions(language), | ||
DisplayOptions: globalOptions.GetSymbolDescriptionOptions(language)); | ||
|
||
public static InlineParameterHintsOptions GetInlineParameterHintsOptions(this IGlobalOptionService globalOptions, string language) | ||
=> new( | ||
EnabledForParameters: globalOptions.GetOption(EnabledForParameters, language), | ||
ForLiteralParameters: globalOptions.GetOption(ForLiteralParameters, language), | ||
ForIndexerParameters: globalOptions.GetOption(ForIndexerParameters, language), | ||
ForObjectCreationParameters: globalOptions.GetOption(ForObjectCreationParameters, language), | ||
ForOtherParameters: globalOptions.GetOption(ForOtherParameters, language), | ||
SuppressForParametersThatDifferOnlyBySuffix: globalOptions.GetOption(SuppressForParametersThatDifferOnlyBySuffix, language), | ||
SuppressForParametersThatMatchMethodIntent: globalOptions.GetOption(SuppressForParametersThatMatchMethodIntent, language), | ||
SuppressForParametersThatMatchArgumentName: globalOptions.GetOption(SuppressForParametersThatMatchArgumentName, language)); | ||
|
||
public static InlineTypeHintsOptions GetInlineTypeHintsOptions(this IGlobalOptionService globalOptions, string language) | ||
=> new( | ||
EnabledForTypes: globalOptions.GetOption(EnabledForTypes, language), | ||
ForImplicitVariableTypes: globalOptions.GetOption(ForImplicitVariableTypes, language), | ||
ForLambdaParameterTypes: globalOptions.GetOption(ForLambdaParameterTypes, language), | ||
ForImplicitObjectCreation: globalOptions.GetOption(ForImplicitObjectCreation, language)); | ||
|
||
private const string FeatureName = "InlineHintsOptions"; | ||
|
||
// Parameter hinds | ||
|
||
public static readonly PerLanguageOption2<bool> EnabledForParameters = | ||
new(FeatureName, | ||
nameof(EnabledForParameters), | ||
InlineParameterHintsOptions.Default.EnabledForParameters, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints")); | ||
|
||
public static readonly PerLanguageOption2<bool> ForLiteralParameters = | ||
new(FeatureName, | ||
nameof(ForLiteralParameters), | ||
InlineParameterHintsOptions.Default.ForLiteralParameters, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.ForLiteralParameters")); | ||
|
||
public static readonly PerLanguageOption2<bool> ForIndexerParameters = | ||
new(FeatureName, | ||
nameof(ForIndexerParameters), | ||
InlineParameterHintsOptions.Default.ForIndexerParameters, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.ForArrayIndexers")); | ||
|
||
public static readonly PerLanguageOption2<bool> ForObjectCreationParameters = | ||
new(FeatureName, | ||
nameof(ForObjectCreationParameters), | ||
InlineParameterHintsOptions.Default.ForObjectCreationParameters, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.ForObjectCreationParameters")); | ||
|
||
public static readonly PerLanguageOption2<bool> ForOtherParameters = | ||
new(FeatureName, | ||
nameof(ForOtherParameters), | ||
InlineParameterHintsOptions.Default.ForOtherParameters, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.ForOtherParameters")); | ||
|
||
public static readonly PerLanguageOption2<bool> SuppressForParametersThatDifferOnlyBySuffix = | ||
new(FeatureName, | ||
nameof(SuppressForParametersThatDifferOnlyBySuffix), | ||
InlineParameterHintsOptions.Default.SuppressForParametersThatDifferOnlyBySuffix, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.SuppressForParametersThatDifferOnlyBySuffix")); | ||
|
||
public static readonly PerLanguageOption2<bool> SuppressForParametersThatMatchMethodIntent = | ||
new(FeatureName, | ||
nameof(SuppressForParametersThatMatchMethodIntent), | ||
InlineParameterHintsOptions.Default.SuppressForParametersThatMatchMethodIntent, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.SuppressForParametersThatMatchMethodIntent")); | ||
|
||
public static readonly PerLanguageOption2<bool> SuppressForParametersThatMatchArgumentName = | ||
new(FeatureName, | ||
nameof(SuppressForParametersThatMatchArgumentName), | ||
InlineParameterHintsOptions.Default.SuppressForParametersThatMatchArgumentName, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.SuppressForParametersThatMatchArgumentName")); | ||
|
||
// Type Hints | ||
|
||
public static readonly PerLanguageOption2<bool> EnabledForTypes = | ||
new(FeatureName, | ||
nameof(EnabledForTypes), | ||
defaultValue: InlineTypeHintsOptions.Default.EnabledForTypes, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineTypeHints")); | ||
|
||
public static readonly PerLanguageOption2<bool> ForImplicitVariableTypes = | ||
new(FeatureName, | ||
nameof(ForImplicitVariableTypes), | ||
defaultValue: InlineTypeHintsOptions.Default.ForImplicitVariableTypes, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineTypeHints.ForImplicitVariableTypes")); | ||
|
||
public static readonly PerLanguageOption2<bool> ForLambdaParameterTypes = | ||
new(FeatureName, | ||
nameof(ForLambdaParameterTypes), | ||
defaultValue: InlineTypeHintsOptions.Default.ForLambdaParameterTypes, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineTypeHints.ForLambdaParameterTypes")); | ||
|
||
public static readonly PerLanguageOption2<bool> ForImplicitObjectCreation = | ||
new(FeatureName, | ||
nameof(ForImplicitObjectCreation), | ||
defaultValue: InlineTypeHintsOptions.Default.ForImplicitObjectCreation, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineTypeHints.ForImplicitObjectCreation")); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/EditorFeatures/Core/QuickInfo/QuickInfoOptionsMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CodeAnalysis.Options; | ||
|
||
namespace Microsoft.CodeAnalysis.QuickInfo | ||
{ | ||
internal static class QuickInfoOptionsMetadata | ||
{ | ||
public static QuickInfoOptions GetQuickInfoOptions(this IGlobalOptionService globalOptions, string? language) | ||
=> new( | ||
ShowRemarksInQuickInfo: globalOptions.GetOption(ShowRemarksInQuickInfo, language), | ||
IncludeNavigationHintsInQuickInfo: globalOptions.GetOption(IncludeNavigationHintsInQuickInfo)); | ||
|
||
private const string FeatureName = "QuickInfoOptions"; | ||
|
||
public static readonly PerLanguageOption2<bool> ShowRemarksInQuickInfo = new( | ||
FeatureName, "ShowRemarksInQuickInfo", QuickInfoOptions.Default.ShowRemarksInQuickInfo, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.ShowRemarks")); | ||
|
||
public static readonly Option2<bool> IncludeNavigationHintsInQuickInfo = new( | ||
FeatureName, "IncludeNavigationHintsInQuickInfo", QuickInfoOptions.Default.IncludeNavigationHintsInQuickInfo, | ||
storageLocation: new RoamingProfileStorageLocation("TextEditor.Specific.IncludeNavigationHintsInQuickInfo")); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/EditorFeatures/Core/SymbolDisplay/SymbolDescriptionOptionsMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CodeAnalysis.Classification; | ||
using Microsoft.CodeAnalysis.Options; | ||
using Microsoft.CodeAnalysis.QuickInfo; | ||
|
||
namespace Microsoft.CodeAnalysis.LanguageServices | ||
{ | ||
internal static class SymbolDescriptionOptionsMetadata | ||
{ | ||
public static SymbolDescriptionOptions GetSymbolDescriptionOptions(this IGlobalOptionService globalOptions, string language) | ||
=> new( | ||
QuickInfoOptions: globalOptions.GetQuickInfoOptions(language), | ||
ClassificationOptions: globalOptions.GetClassificationOptions(language)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.