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

Do not expose private getters and setters #47

Merged
merged 5 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/DocEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Summary.DocEvent](../src/Core/DocEvent.cs#L9)
```cs
public record DocEvent : DocMember
```

A [`DocMember`](./DocMember.md) that represents a documented event in the parsed source code.

_Similar to [`DocProperty`](./DocProperty.md) but with its own set of accessors._

## Properties
### [Type](../src/Core/DocEvent.cs#L14)
```cs
public required DocType Type { get; init; }
```

The type of the event.

22 changes: 18 additions & 4 deletions docs/DocProperty.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
# [Summary.DocProperty](../src/Core/DocProperty.cs#L6)
# [Summary.DocProperty](../src/Core/DocProperty.cs#L8)
```cs
public record DocProperty : DocMember
```

A [`DocMember`](./DocMember.md) that represents a documented property in the parsed source code.

## Properties
### [Type](../src/Core/DocProperty.cs#L11)
### [Type](../src/Core/DocProperty.cs#L13)
```cs
public required DocType Type { get; init; }
```

The type of the property.

### [Generated](../src/Core/DocProperty.cs#L16)
### [Accessors](../src/Core/DocProperty.cs#L18)
```cs
public required DocPropertyAccessor[] Accessors { get; init; }
```

The accessors of the property (e.g., `get`, `set`, `init`).

### [Generated](../src/Core/DocProperty.cs#L23)
```cs
public required bool Generated { get; init; }
```

Whether this property was generated by compiler (e.g., it's a property of a record).

### [Event](../src/Core/DocProperty.cs#L21)
### [Event](../src/Core/DocProperty.cs#L29)
```cs
public required bool Event { get; init; }
```

Whether this property represents an event.

### [AccessorsDeclaration](../src/Core/DocProperty.cs#L34)
```cs
public string AccessorsDeclaration { get; }
```

The declaration of property accessors as they declared in the C# source code.

38 changes: 38 additions & 0 deletions docs/DocPropertyAccessor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# [Summary.DocPropertyAccessor](../src/Core/DocPropertyAccessor.cs#L6)
```cs
public record DocPropertyAccessor
```

One of the [`DocProperty`](./DocProperty.md) accessors (e.g., `get`, `set`, `init`).

## Fields
### [Access](../src/Core/DocPropertyAccessor.cs#L29)
```cs
public AccessModifier? Access
```

The access modifier of the accessor.
If the value is `null`, then the access modifier is inherited from the property declaration.

### [Kind](../src/Core/DocPropertyAccessor.cs#L34)
```cs
public AccessorKind Kind
```

The kind of the accessor.

## Methods
### [Defaults()](../src/Core/DocPropertyAccessor.cs#L11)
```cs
public static DocPropertyAccessor[] Defaults()
```

The sequence that consists only of a default `public get` property accessor.

### [Default()](../src/Core/DocPropertyAccessor.cs#L19)
```cs
public static DocPropertyAccessor Default()
```

The default `public get` property accessor.

7 changes: 4 additions & 3 deletions docs/FilterMemberPipe.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# [Summary.Pipes.Filters.FilterMemberPipe](../src/Core/Pipes/Filters/FilterMemberPipe.cs#L6)
# [Summary.Pipes.Filters.FilterMemberPipe](../src/Core/Pipes/Filters/FilterMemberPipe.cs#L7)
```cs
public class FilterMemberPipe : IPipe<Doc, Doc>
```

A simple pipe that filters all members inside the document using the specified predicate.
A simple pipe that filters all members inside the document using the specified predicate
and then applies the given map function on them.

## Methods
### [Run(Doc)](../src/Core/Pipes/Filters/FilterMemberPipe.cs#L9)
### [Run(Doc)](../src/Core/Pipes/Filters/FilterMemberPipe.cs#L12)
```cs
public Task<Doc> Run(Doc input)
```
Expand Down
61 changes: 61 additions & 0 deletions docs/FilteringExtensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# [Summary.Pipelines.FilteringExtensions](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L9)
```cs
public static class FilteringExtensions
```

A set of extensions for [`SummaryPipeline`](./SummaryPipeline.md) that add support for filtering functionality.

## Methods
### [UseDefaultFilters(SummaryPipeline)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L14)
```cs
public static SummaryPipeline UseDefaultFilters(this SummaryPipeline self)
```

Enables default filters for the given pipeline (i.e. a filter that removes all non-public members).

### [IncludeAtLeast(SummaryPipeline, AccessModifier)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L29)
```cs
public static SummaryPipeline IncludeAtLeast(this SummaryPipeline self, AccessModifier access)
```

Includes only members that have at least the given access modifier.

#### Example
In order to include both `internal` and `public` members in the generated docs,
you can call this method as follows:
```cs
var pipeline = ...;

pipeline.IncludeAtLeast(AccessModifier.Internal);
```

### [IncludeOnly(SummaryPipeline, AccessModifier)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L44)
```cs
public static SummaryPipeline IncludeOnly(this SummaryPipeline self, AccessModifier access)
```

Includes only members that have at least the given access modifier.

#### Example
In order to include onl `internal` members in the generated docs,
you can call this method as follows:
```cs
var pipeline = ...;

pipeline.IncludeOnly(AccessModifier.Internal);
```

### [WithAccess(SummaryPipeline, Func<AccessModifier, bool>)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L50)
```cs
public static SummaryPipeline WithAccess(this SummaryPipeline self, Func<AccessModifier, bool> p)
```

Includes only members that have the access modifier that satisfies the given predicate.

### [UseFilter(SummaryPipeline, IPipe<Doc, Doc>)](../src/Core/Pipelines/SummaryPipelineFilteringExtensions.cs#L67)
```cs
public static SummaryPipeline UseFilter(this SummaryPipeline self, IPipe<Doc, Doc> filter)
```

Adds the given filter into the pipeline.

2 changes: 1 addition & 1 deletion docs/GlobalDelegate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [GlobalDelegate(int, int)](../src/Core/Samples/Sample.cs#L6)
# [GlobalDelegate(int, int)](../src/Core/Samples/Sample.cs#L15)
```cs
public void GlobalDelegate(int x, int y)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/Sample{T0,T1}.Child.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [~~Summary.Samples.Sample.Child~~](../src/Core/Samples/Sample.cs#L33)
# [~~Summary.Samples.Sample.Child~~](../src/Core/Samples/Sample.cs#L42)
> [!WARNING]
> The type is deprecated.

Expand All @@ -10,7 +10,7 @@ public class Child
A child of the [`Sample{T0,T1}`](./Sample{T0,T1}.md) class.

## Fields
### [Field](../src/Core/Samples/Sample.cs#L38)
### [Field](../src/Core/Samples/Sample.cs#L47)
```cs
public int Field
```
Expand Down
36 changes: 18 additions & 18 deletions docs/Sample{T0,T1}.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [Summary.Samples.Sample<T0, T1>](../src/Core/Samples/Sample.cs#L26)
# [Summary.Samples.Sample<T0, T1>](../src/Core/Samples/Sample.cs#L35)
```cs
public class Sample<T0, T1>
```
Expand All @@ -22,37 +22,37 @@ _Btw, this type has a child: [`Sample{T0,T1}.Child`](./Sample{T0,T1}.Child.md)._
- `T1`: A second type parameter.

## Delegates
### [Delegate1(int, int)](../src/Core/Samples/Sample.cs#L44)
### [Delegate1(int, int)](../src/Core/Samples/Sample.cs#L53)
```cs
public void Delegate1(int x, int y)
```

A sample delegate.

## Events
### [Event1](../src/Core/Samples/Sample.cs#L92)
### [Event1](../src/Core/Samples/Sample.cs#L101)
```cs
public event Action Event1
```

A sample field event.

### [Event2](../src/Core/Samples/Sample.cs#L97)
### [Event2](../src/Core/Samples/Sample.cs#L106)
```cs
public Action Event2 { add; remove; }
public Action Event2
```

A sample property event.

## Fields
### [Field](../src/Core/Samples/Sample.cs#L38)
### [Field](../src/Core/Samples/Sample.cs#L47)
```cs
public int Field
```

A field of the child class.

### [~~Field1~~](../src/Core/Samples/Sample.cs#L50)
### [~~Field1~~](../src/Core/Samples/Sample.cs#L59)
> [!WARNING]
> The field is deprecated.

Expand All @@ -63,54 +63,54 @@ public int Field1

A sample field.

### [Field2](../src/Core/Samples/Sample.cs#L55)
### [Field2](../src/Core/Samples/Sample.cs#L64)
```cs
public int Field2
```

A pair of fields.

### [Field3](../src/Core/Samples/Sample.cs#L55)
### [Field3](../src/Core/Samples/Sample.cs#L64)
```cs
public int Field3
```

A pair of fields.

## Properties
### [Property1](../src/Core/Samples/Sample.cs#L60)
### [Property1](../src/Core/Samples/Sample.cs#L69)
```cs
public int Property1 { get; set; }
```

A sample property.

### [Property2](../src/Core/Samples/Sample.cs#L65)
### [Property2](../src/Core/Samples/Sample.cs#L74)
```cs
public int Property2 { private get; set; }
public int Property2 { set; }
```

A sample property with custom visibility.

### [Property3](../src/Core/Samples/Sample.cs#L71)
### [Property3](../src/Core/Samples/Sample.cs#L80)
```cs
public int Property3 { get; protected set; }
public int Property3 { get; }
```

A sample property with custom visibility and an exception.

#### Exceptions
- `ArithmeticException`: Invalid number.

### [Property4](../src/Core/Samples/Sample.cs#L76)
### [Property4](../src/Core/Samples/Sample.cs#L85)
```cs
public int Property4 { get; set; }
```

A sample property with custom accessors.

## Indexers
### [this[int]](../src/Core/Samples/Sample.cs#L87)
### [this[int]](../src/Core/Samples/Sample.cs#L96)
```cs
public int this[int i] { get; }
```
Expand All @@ -124,7 +124,7 @@ A sample indexer.
What indexer returns.

## Methods
### [Method<M0, M1, M2>(int, string)](../src/Core/Samples/Sample.cs#L121)
### [Method<M0, M1, M2>(int, string)](../src/Core/Samples/Sample.cs#L130)
```cs
public TimeSpan Method<M0, M1, M2>(int x, string y)
```
Expand Down Expand Up @@ -154,7 +154,7 @@ The `TimeSpan` instance.
- `ArgumentException`: The argument is incorrect.
- `ApplicationException`: Something went wrong.

### [Method<M0, M1, M2>(short, string)](../src/Core/Samples/Sample.cs#L128)
### [Method<M0, M1, M2>(short, string)](../src/Core/Samples/Sample.cs#L137)
```cs
public TimeSpan Method<M0, M1, M2>(short x, string y)
```
Expand Down
46 changes: 0 additions & 46 deletions docs/SummaryPipelineExtensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,3 @@ Specifies the logger factory to use for pipes inside the pipeline.
_This method should be called _before_ anything else so that_
_given logger factory is passed into all subsequent calls._

### [UseDefaultFilters(SummaryPipeline)](../src/Core/Pipelines/SummaryPipelineExtensions.cs#L25)
```cs
public static SummaryPipeline UseDefaultFilters(this SummaryPipeline self)
```

Enables default filters for the given pipeline (i.e. a filter that removes all non-public members).

### [IncludeAtLeast(SummaryPipeline, AccessModifier)](../src/Core/Pipelines/SummaryPipelineExtensions.cs#L40)
```cs
public static SummaryPipeline IncludeAtLeast(this SummaryPipeline self, AccessModifier access)
```

Includes only members that have at least the given access modifier.

#### Example
In order to include both `internal` and `public` members in the generated docs,
you can call this method as follows:
```cs
var pipeline = ...;

pipeline.IncludeAtLeast(AccessModifier.Internal);
```

### [IncludeOnly(SummaryPipeline, AccessModifier)](../src/Core/Pipelines/SummaryPipelineExtensions.cs#L55)
```cs
public static SummaryPipeline IncludeOnly(this SummaryPipeline self, AccessModifier access)
```

Includes only members that have at least the given access modifier.

#### Example
In order to include onl `internal` members in the generated docs,
you can call this method as follows:
```cs
var pipeline = ...;

pipeline.IncludeOnly(AccessModifier.Internal);
```

### [UseFilter(SummaryPipeline, IPipe<Doc, Doc>)](../src/Core/Pipelines/SummaryPipelineExtensions.cs#L62)
```cs
public static SummaryPipeline UseFilter(this SummaryPipeline self, IPipe<Doc, Doc> filter)
```

Adds the given filter into the pipeline.

Loading