Skip to content

Commit 863c4e0

Browse files
committed
Rename "Provider" to "FeatureProvider"
This name change will help the purpose of this design to be more obvious and also distinguish it from other PowerShell features that are called "providers."
1 parent e02498f commit 863c4e0

14 files changed

+23
-23
lines changed

src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ internal class CodeLensFeature : ICodeLenses
2525
JsonSerializer.Create(
2626
Constants.JsonSerializerSettings);
2727

28-
public IProviderCollection<ICodeLensProvider> Providers { get; } =
29-
new ProviderCollection<ICodeLensProvider>();
28+
public IFeatureProviderCollection<ICodeLensProvider> Providers { get; } =
29+
new FeatureProviderCollection<ICodeLensProvider>();
3030

3131
public CodeLensFeature(
3232
EditorSession editorSession,

src/PowerShellEditorServices.Host/CodeLens/ReferencesCodeLensProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace Microsoft.PowerShell.EditorServices.CodeLenses
1616
{
17-
internal class ReferencesCodeLensProvider : ProviderBase, ICodeLensProvider
17+
internal class ReferencesCodeLensProvider : FeatureProviderBase, ICodeLensProvider
1818
{
1919
private EditorSession editorSession;
2020
private IDocumentSymbolProvider symbolProvider;

src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ internal class DocumentSymbolFeature : IDocumentSymbols
2121
{
2222
private EditorSession editorSession;
2323

24-
public IProviderCollection<IDocumentSymbolProvider> Providers { get; } =
25-
new ProviderCollection<IDocumentSymbolProvider>();
24+
public IFeatureProviderCollection<IDocumentSymbolProvider> Providers { get; } =
25+
new FeatureProviderCollection<IDocumentSymbolProvider>();
2626

2727
public DocumentSymbolFeature(
2828
EditorSession editorSession,

src/PowerShellEditorServices/CodeLenses/ICodeLensProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.PowerShell.EditorServices.CodeLenses
1414
/// <summary>
1515
/// Specifies the contract for a Code Lens provider.
1616
/// </summary>
17-
public interface ICodeLensProvider : IProvider
17+
public interface ICodeLensProvider : IFeatureProvider
1818
{
1919
/// <summary>
2020
/// Provides a collection of CodeLenses for the given

src/PowerShellEditorServices/CodeLenses/ICodeLenses.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface ICodeLenses
1919
/// Gets the collection of ICodeLensProvider implementations
2020
/// that are registered with this component.
2121
/// </summary>
22-
IProviderCollection<ICodeLensProvider> Providers { get; }
22+
IFeatureProviderCollection<ICodeLensProvider> Providers { get; }
2323

2424
/// <summary>
2525
/// Provides a collection of CodeLenses for the given

src/PowerShellEditorServices/Providers/ProviderBase.cs renamed to src/PowerShellEditorServices/Providers/FeatureProviderBase.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
namespace Microsoft.PowerShell.EditorServices
77
{
88
/// <summary>
9-
/// Provides a base implementation of IProvider.
9+
/// Provides a base implementation of IFeatureProvider.
1010
/// </summary>
11-
public abstract class ProviderBase : IProvider
11+
public abstract class FeatureProviderBase : IFeatureProvider
1212
{
1313
/// <summary>
1414
/// Gets the provider class type's FullName as the

src/PowerShellEditorServices/Providers/ProviderCollection.cs renamed to src/PowerShellEditorServices/Providers/FeatureProviderCollection.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
namespace Microsoft.PowerShell.EditorServices
1111
{
1212
/// <summary>
13-
/// Provides a default implementation of IProviderCollection.
13+
/// Provides a default implementation of IFeatureProviderCollection.
1414
/// </summary>
15-
public class ProviderCollection<TProvider> : IProviderCollection<TProvider>
16-
where TProvider : IProvider
15+
public class FeatureProviderCollection<TProvider> : IFeatureProviderCollection<TProvider>
16+
where TProvider : IFeatureProvider
1717
{
1818
#region Private Fields
1919

2020
private List<TProvider> providerList = new List<TProvider>();
2121

2222
#endregion
2323

24-
#region IProviderCollection Implementation
24+
#region IFeatureProviderCollection Implementation
2525

26-
void IProviderCollection<TProvider>.Add(TProvider provider)
26+
void IFeatureProviderCollection<TProvider>.Add(TProvider provider)
2727
{
2828
if (!this.providerList.Contains(provider))
2929
{

src/PowerShellEditorServices/Providers/IProvider.cs renamed to src/PowerShellEditorServices/Providers/IFeatureProvider.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace Microsoft.PowerShell.EditorServices
88
/// <summary>
99
/// Defines the contract for a feature provider, particularly for provider identification.
1010
/// </summary>
11-
public interface IProvider
11+
public interface IFeatureProvider
1212
{
1313
/// <summary>
14-
/// Specifies a unique identifier for a provider, typically a
14+
/// Specifies a unique identifier for the feature provider, typically a
1515
/// fully-qualified name like "Microsoft.PowerShell.EditorServices.MyProvider"
1616
/// </summary>
1717
string ProviderId { get; }

src/PowerShellEditorServices/Providers/IProviderCollection.cs renamed to src/PowerShellEditorServices/Providers/IFeatureProviderCollection.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices
1010
/// <summary>
1111
/// Defines the contract for a collection of provider implementations.
1212
/// </summary>
13-
public interface IProviderCollection<TProvider> : IEnumerable<TProvider>
14-
where TProvider : IProvider
13+
public interface IFeatureProviderCollection<TProvider> : IEnumerable<TProvider>
14+
where TProvider : IFeatureProvider
1515
{
1616
/// <summary>
1717
/// Adds a provider to the collection.

src/PowerShellEditorServices/Symbols/IDocumentSymbolProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.PowerShell.EditorServices.Symbols
1010
/// <summary>
1111
/// Specifies the contract for a document symbols provider.
1212
/// </summary>
13-
public interface IDocumentSymbolProvider : IProvider
13+
public interface IDocumentSymbolProvider : IFeatureProvider
1414
{
1515
/// <summary>
1616
/// Provides a list of symbols for the given document.

src/PowerShellEditorServices/Symbols/IDocumentSymbols.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public interface IDocumentSymbols
1717
/// Gets the collection of IDocumentSymbolsProvider implementations
1818
/// that are registered with this component.
1919
/// </summary>
20-
IProviderCollection<IDocumentSymbolProvider> Providers { get; }
20+
IFeatureProviderCollection<IDocumentSymbolProvider> Providers { get; }
2121

2222
/// <summary>
2323
/// Provides a list of symbols for the given document.

src/PowerShellEditorServices/Symbols/PesterDocumentSymbolProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.PowerShell.EditorServices.Symbols
1414
/// Provides an IDocumentSymbolProvider implementation for
1515
/// enumerating test symbols in Pester test (tests.ps1) files.
1616
/// </summary>
17-
public class PesterDocumentSymbolProvider : ProviderBase, IDocumentSymbolProvider
17+
public class PesterDocumentSymbolProvider : FeatureProviderBase, IDocumentSymbolProvider
1818
{
1919
IEnumerable<SymbolReference> IDocumentSymbolProvider.ProvideDocumentSymbols(
2020
ScriptFile scriptFile)

src/PowerShellEditorServices/Symbols/PsdDocumentSymbolProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.PowerShell.EditorServices.Symbols
1313
/// Provides an IDocumentSymbolProvider implementation for
1414
/// enumerating symbols in .psd1 files.
1515
/// </summary>
16-
public class PsdDocumentSymbolProvider : ProviderBase, IDocumentSymbolProvider
16+
public class PsdDocumentSymbolProvider : FeatureProviderBase, IDocumentSymbolProvider
1717
{
1818
IEnumerable<SymbolReference> IDocumentSymbolProvider.ProvideDocumentSymbols(
1919
ScriptFile scriptFile)

src/PowerShellEditorServices/Symbols/ScriptDocumentSymbolProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.PowerShell.EditorServices.Symbols
1313
/// Provides an IDocumentSymbolProvider implementation for
1414
/// enumerating symbols in script (.psd1, .psm1) files.
1515
/// </summary>
16-
public class ScriptDocumentSymbolProvider : ProviderBase, IDocumentSymbolProvider
16+
public class ScriptDocumentSymbolProvider : FeatureProviderBase, IDocumentSymbolProvider
1717
{
1818
private Version powerShellVersion;
1919

0 commit comments

Comments
 (0)