Class PythonTextEdit


  • public class PythonTextEdit
    extends Object
    For internal use only. Can not be used outside SonarPython analyzer.
    • Constructor Detail

      • PythonTextEdit

        public PythonTextEdit​(String message,
                              int startLine,
                              int startLineOffset,
                              int endLine,
                              int endLineOffset)
    • Method Detail

      • insertLineBefore

        public static PythonTextEdit insertLineBefore​(Tree tree,
                                                      String textToInsert)
        Insert a line with the same offset as the given tree, before the given tree. Offset is applied to multiline insertions.
      • shiftLeft

        public static List<PythonTextEdit> shiftLeft​(StatementList statementList)
        Shift body statements to be on same level as the parent statement Filter out text edits which apply on the same line which could show up with multiple statements on the same line
      • removeRange

        public static PythonTextEdit removeRange​(int startLine,
                                                 int startColumn,
                                                 int endLine,
                                                 int endColumn)
      • removeUntil

        public static PythonTextEdit removeUntil​(Tree start,
                                                 Tree until)
        Remove range including the start token until the beginning of the end tree's first token. This is useful to remove and shift multiple statement over multiple lines.
      • replacementText

        public String replacementText()
      • startLine

        public int startLine()
      • startLineOffset

        public int startLineOffset()
      • endLine

        public int endLine()
      • endLineOffset

        public int endLineOffset()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object