Class

scalafix.internal.rule

RuleCtxImpl

Related Doc: package rule

Permalink

case class RuleCtxImpl(tree: Tree, config: ScalafixConfig, diffDisable: DiffDisable) extends v0.RuleCtx with LegacyPatchOps with Product with Serializable

Self Type
RuleCtxImpl
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RuleCtxImpl
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. LegacyPatchOps
  7. RuleCtx
  8. PatchOps
  9. AnyRef
  10. Any
Implicitly
  1. by XtensionScalafixProductInspect
  2. by XtensionScalafixProductInspect
  3. by any2stringadd
  4. by StringFormat
  5. by Ensuring
  6. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RuleCtxImpl(tree: Tree, config: ScalafixConfig, diffDisable: DiffDisable)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to any2stringadd[RuleCtxImpl] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (RuleCtxImpl, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to ArrowAssoc[RuleCtxImpl] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. lazy val comments: AssociatedComments

    Permalink

    Find comments/docstrings associated with tree nodes.

    Find comments/docstrings associated with tree nodes. *

    Definition Classes
    RuleCtxImplRuleCtx
  9. val config: ScalafixConfig

    Permalink
    Definition Classes
    RuleCtxImplRuleCtx
  10. def debug(values: Text[Any]*)(implicit fileLine: FileLine): Unit

    Permalink
  11. def debugIndex()(implicit index: util.SemanticdbIndex, fileLine: FileLine): Unit

    Permalink

    Print out the contents of SemanticdbIndex for this input only.

    Print out the contents of SemanticdbIndex for this input only. *

    Definition Classes
    RuleCtxImplRuleCtx
  12. val diffDisable: DiffDisable

    Permalink
    Definition Classes
    RuleCtxImplRuleCtx
  13. def ensuring(cond: (RuleCtxImpl) ⇒ Boolean, msg: ⇒ Any): RuleCtxImpl

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to Ensuring[RuleCtxImpl] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (RuleCtxImpl) ⇒ Boolean): RuleCtxImpl

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to Ensuring[RuleCtxImpl] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): RuleCtxImpl

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to Ensuring[RuleCtxImpl] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): RuleCtxImpl

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to Ensuring[RuleCtxImpl] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. lazy val escapeHatch: EscapeHatch

    Permalink
    Definition Classes
    RuleCtxImplRuleCtx
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to StringFormat[RuleCtxImpl] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. def index(implicit index: util.SemanticdbIndex): util.SemanticdbIndex

    Permalink

    Get SemanticdbIndex for this single tree alone.

    Get SemanticdbIndex for this single tree alone.

    Definition Classes
    RuleCtxImplRuleCtx
  23. lazy val input: scala.meta.Input

    Permalink

    The input where the tree was parsed from.

    The input where the tree was parsed from.

    This is typically either Input.VirtualFile for semantic rules and Input.File for syntactic rules. For Input.VirtualFile, it is possible to trace back to the original file path via SemanticdbIndex.sourcepath.

    Definition Classes
    RuleCtxImplRuleCtx
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. lazy val matchingParens: MatchingParens

    Permalink

    Find matching open/close pairs of parens/braces/brackets.

    Find matching open/close pairs of parens/braces/brackets. *

    Definition Classes
    RuleCtxImplRuleCtx
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def syntax: String

    Permalink
  31. def toString(): String

    Permalink
    Definition Classes
    RuleCtxImpl → AnyRef → Any
  32. lazy val tokenList: TokenList

    Permalink

    Traverse tokens as a doubly linked list.

    Traverse tokens as a doubly linked list. *

    Definition Classes
    RuleCtxImplRuleCtx
  33. lazy val tokens: Tokens

    Permalink

    The tokenized tokens of this this tree.

    The tokenized tokens of this this tree. *

    Definition Classes
    RuleCtxImplRuleCtx
  34. def toks(t: Tree): Tokens

    Permalink
    Definition Classes
    RuleCtxImplRuleCtx
  35. val tree: Tree

    Permalink

    The parsed syntax tree that should be fixed.

    The parsed syntax tree that should be fixed.

    The scalafix API does not support fixing un-parseable code at this point.

    Definition Classes
    RuleCtxImplRuleCtx
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def [B](y: B): (RuleCtxImpl, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to ArrowAssoc[RuleCtxImpl] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def structure(printWidth: Int): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to scalafix.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: scalafix.XtensionScalafixProductInspect).structure(printWidth)
    Definition Classes
    XtensionScalafixProductInspect
  2. def structure: String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to scalafix.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: scalafix.XtensionScalafixProductInspect).structure
    Definition Classes
    XtensionScalafixProductInspect
  3. def structure(printWidth: Int): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to v0.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: v0.XtensionScalafixProductInspect).structure(printWidth)
    Definition Classes
    XtensionScalafixProductInspect
  4. def structure: String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to v0.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: v0.XtensionScalafixProductInspect).structure
    Definition Classes
    XtensionScalafixProductInspect
  5. def structureLabeled(printWidth: Int): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to scalafix.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: scalafix.XtensionScalafixProductInspect).structureLabeled(printWidth)
    Definition Classes
    XtensionScalafixProductInspect
  6. def structureLabeled: String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to scalafix.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: scalafix.XtensionScalafixProductInspect).structureLabeled
    Definition Classes
    XtensionScalafixProductInspect
  7. def structureLabeled(printWidth: Int): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to v0.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: v0.XtensionScalafixProductInspect).structureLabeled(printWidth)
    Definition Classes
    XtensionScalafixProductInspect
  8. def structureLabeled: String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RuleCtxImpl to v0.XtensionScalafixProductInspect performed by method XtensionScalafixProductInspect in scalafix.util.Api.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (ruleCtxImpl: v0.XtensionScalafixProductInspect).structureLabeled
    Definition Classes
    XtensionScalafixProductInspect

Deprecated Value Members

  1. final def addGlobalImport(symbol: Symbol)(implicit index: v0.SemanticdbIndex): v0.Patch

    Permalink

    Add an import on symbol among the global imports.

    Add an import on symbol among the global imports.

    This patch is not reference, unlike removeImportee(Importee). It is only necessary to use this patch once per tree, duplicate symbols are ignored.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  2. final def addGlobalImport(importer: Importer): v0.Patch

    Permalink

    Add this importer to the global imports at the top of this file.

    Add this importer to the global imports at the top of this file.

    It is OK to pass in a quasiquote here. The importer has no attached semantic information, so it's not possible to deduplicate Importers.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  3. final def addLeft(tree: Tree, toAdd: String): v0.Patch

    Permalink

    Add the string toAdd to the first token of tree.

    Add the string toAdd to the first token of tree. Does not remove tokens.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  4. final def addLeft(tok: scala.meta.Token, toAdd: String): v0.Patch

    Permalink

    Add the string toAdd to the left side of token, while keeping token.

    Add the string toAdd to the left side of token, while keeping token.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  5. final def addRight(tree: Tree, toAdd: String): v0.Patch

    Permalink

    Add the string toAdd to the last token of tree.

    Add the string toAdd to the last token of tree. Does not remove tokens.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  6. final def addRight(tok: scala.meta.Token, toAdd: String): v0.Patch

    Permalink

    Add the string toAdd to the right side of token, while keeping token.

    Add the string toAdd to the right side of token, while keeping token.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  7. final def lint(msg: v0.Diagnostic): v0.Patch

    Permalink

    Report a linter message.

    Report a linter message.

    To construct a LintMessage, start by creating a lint category. Example:

    class MyLinter extends Rule {
      val divisionByZero = scalafix.LintCategory.error("Division by zero!")
      val divisionTree: scala.meta.Tree = ???
      PatchOps.lint(divisionByZero.at(divisionTree.pos))
    }

    Each LintCategory is assigned a unique identifier, which is formatted as "RuleName.categoryID". The divisionByZero example would have the id "MyLinter.divisionByZero". A LintCategory has a default severity level (warning, error) that the user can override in .scalafix.conf.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  8. final def removeGlobalImport(symbol: Symbol)(implicit index: v0.SemanticdbIndex): v0.Patch

    Permalink

    Remove importees that resolve to symbol.

    Remove importees that resolve to symbol.

    Note, this patch is not reference, unlike removeImportee(Importee). It is only necessary to use this patch once per tree, duplicate symbols are ignored.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  9. final def removeImportee(importee: Importee): v0.Patch

    Permalink

    Remove this particular instance of Importee.

    Remove this particular instance of Importee.

    Handles tricky cases like trailing commas or curly braces. Example, removeImportee(b) in import a.{b, c} produces import a.c.

    Note, importee instance is by reference, so removing quasiquotes (example, removeImportee(importee"b")) does nothing.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  10. final def removeToken(token: scala.meta.Token): v0.Patch

    Permalink

    Replace single token with empty string.

    Replace single token with empty string.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  11. final def removeTokens(tokens: Iterable[scala.meta.Token]): v0.Patch

    Permalink
    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  12. final def removeTokens(tokens: Tokens): v0.Patch

    Permalink

    Replace all tokens with empty string.

    Replace all tokens with empty string.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  13. final def renameSymbol(fromSymbol: Global, toName: String)(implicit index: v0.SemanticdbIndex): v0.Patch

    Permalink

    Replace appearances of names that reference fromSymbol with toName.

    Replace appearances of names that reference fromSymbol with toName.

    toName should be a legal identifier, it cannot be a tree such as foo(). Use this patch for example to rename a methods on a class.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  14. final def replaceSymbol(fromSymbol: Global, toSymbol: Global)(implicit index: v0.SemanticdbIndex): v0.Patch

    Permalink

    Replace references/call-sites to fromSymbol with references to toSymbol.

    Replace references/call-sites to fromSymbol with references to toSymbol.

    toSymbol must be a static method or a globally accessible object. toSymbol should not be path dependent. To rename a class method, use renameSymbol.

    Experimental. May produce broken code in some cases. This is the same patch as replace:com.foo/com.bar from sbt-scalafix.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  15. final def replaceSymbols(toReplace: Seq[(String, String)])(implicit noop: DummyImplicit, index: v0.SemanticdbIndex): v0.Patch

    Permalink

    Helper for calling replaceSymbols without needing _*

    Helper for calling replaceSymbols without needing _*

    Defers work to replaceSymbols((String, String)*). Needs a dummy implicit to differentiate from replaceSymbols((String, String)*) after type erasure

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  16. final def replaceSymbols(toReplace: (String, String)*)(implicit index: v0.SemanticdbIndex): v0.Patch

    Permalink

    Shorthand for calling replaceSymbol from strings.

    Shorthand for calling replaceSymbol from strings.

    String values are treated as Symbol.Global.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  17. final def replaceToken(token: scala.meta.Token, toReplace: String): v0.Patch

    Permalink

    Replace the entire contents of this Token with toReplace.

    Replace the entire contents of this Token with toReplace.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

  18. final def replaceTree(from: Tree, to: String): v0.Patch

    Permalink

    Replace all tokens of tree contents with toReplace.

    Replace all tokens of tree contents with toReplace.

    Definition Classes
    LegacyPatchOpsPatchOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.0)

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from LegacyPatchOps

Inherited from v0.RuleCtx

Inherited from PatchOps

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion XtensionScalafixProductInspect from RuleCtxImpl to scalafix.XtensionScalafixProductInspect

Inherited by implicit conversion XtensionScalafixProductInspect from RuleCtxImpl to v0.XtensionScalafixProductInspect

Inherited by implicit conversion any2stringadd from RuleCtxImpl to any2stringadd[RuleCtxImpl]

Inherited by implicit conversion StringFormat from RuleCtxImpl to StringFormat[RuleCtxImpl]

Inherited by implicit conversion Ensuring from RuleCtxImpl to Ensuring[RuleCtxImpl]

Inherited by implicit conversion ArrowAssoc from RuleCtxImpl to ArrowAssoc[RuleCtxImpl]

Ungrouped