Open sandboxFocusImprove this doc
  • Article

Namespace Metalama.Framework.CodeFixes

This namespace enables you to suggest code fixes and code refactorings, which are changes to source code that appear in the lightbulb or screwdriver menu of your IDE.

You can instantiate code fixes using the static methods of the CodeFixFactory class.

To add code fixes to a diagnostic, utilize the IDiagnostic.WithCodeFixes method.

To suggest a code refactoring without reporting a diagnostic, employ the Suggesttext=ScopedDiagnosticSink.Suggest> method.

Class diagram

Namespace members

Classes

CodeFix

Represents a modification of the current solution, including the Title of transformation. To instantiate a single-step code fix, use CodeFixFactory. To instantiate a more complex code fix, use the constructor.

CodeFixFactory

Creates instances of the CodeFix class.

Interfaces

ICodeActionBuilder

Argument of the delegate passed to CodeFix constructor. Exposes methods that allow to modify the current solution.

ICodeActionContext

Gets the context in which a code action executes. Exposed by ICodeActionBuilder. If you implement your own code action using the Metalama SDK, you should cast this interface to ISdkCodeActionContext.

ScopedDiagnosticSink
Report()
Suppress()
Suggest()
IDiagnostic
CodeFixes
WithCodeFixes(CodeFixes[])
CodeFix
Id
Title
CodeFixFactory
ApplyAspect()
AddAttribute()
RemoteAttribute()
Syntax error in graphmermaid version 9.4.3