Class BslCommentUiUtils

java.lang.Object
com._1c.g5.v8.dt.bsl.ui.contentassist.BslCommentUiUtils

public final class BslCommentUiUtils extends Object
Contains method for working with comment template in BSL
Restriction:
This class is not intended to be sub-classed by clients.
  • Method Details

    • createEmptyTemplate

      public static BslCommentUiUtils.TemplateDescription createEmptyTemplate(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, boolean isFunc, String lineFormatter, String indent, ScriptVariant lang, IV8ProjectManager v8projectManager, boolean oldFormat)
      Create comment template for method in BSL.
      Parameters:
      doc - needs to create LinkedPosition, can't be null
      posInsert - supposed position of the template inserting
      method - method in BSL, may be null
      isFunc - true, if need template for function, false - for procedure
      lineFormatter - actual format string, can't be null
      indent - actual text editor indent, can't be null
      lang - actual script variant, can't be null
      v8projectManager - the IV8ProjectManager, can't be null
      oldFormat - true if comment should be in old format, false in new format
      Returns:
      description of created template BslCommentUiUtils.TemplateDescription, never null
    • createTemplateForMethod

      public static BslCommentUiUtils.TemplateDescription createTemplateForMethod(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, String lineFormatter, String indent, TypesComputer typesComputer, BslMultiLineCommentDocumentationProvider commentProvider, IV8ProjectManager v8projectManager, boolean oldFormat)
      Creates template based on Method.
      Parameters:
      doc - needs to create LinkedPosition, can't be null
      posInsert - supposed position of the template inserting
      method - method in BSL, can't be null
      lineFormatter - actual format string, can't be null
      indent - actual text editor indent, can't be null
      typesComputer - actual TypesComputer, cannot be null
      commentProvider - actual BslMultiLineCommentDocumentationProvider, can't be null
      v8projectManager - IV8ProjectManager, can't be null
      oldFormat - true if comment should be in old format, false in new format
      Returns:
      description of created template BslCommentUiUtils.TemplateDescription, never null
    • createOrUpdateTemplateForMethod

      public static BslCommentUiUtils.TemplateDescription createOrUpdateTemplateForMethod(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, String lineFormatter, String indent, TypesComputer typesComputer, BslMultiLineCommentDocumentationProvider commentProvider, IV8ProjectManager v8projectManager, boolean oldFormat)
      Creates or update template based on Method.
      Parameters:
      doc - needs to create LinkedPosition, can't be null
      posInsert - supposed position of the template inserting
      method - method in BSL, can't be null
      lineFormatter - actual format string, can't be null
      indent - actual text editor indent, can't be null
      typesComputer - actual TypesComputer, cannot be null
      commentProvider - actual BslMultiLineCommentDocumentationProvider, can't be null
      v8projectManager - IV8ProjectManager, can't be null
      oldFormat - true if comment should be in old format, false in new format
      Returns:
      description of created template BslCommentUiUtils.TemplateDescription, never null
    • createTemplateTextForMethod

      public static String createTemplateTextForMethod(Method method, String descr, String lineFormatter, String indent, TypesComputer typesComputer, IV8ProjectManager v8projectManager, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, boolean isRussian)
      Creates template based on Method
      Parameters:
      method - method in BSL, can't be null
      descr - comment main description? cannot be null
      lineFormatter - actual format string, can't be null
      indent - actual text editor indent, can't be null
      typesComputer - actual TypesComputer, cannot be null
      v8projectManager - IV8ProjectManager, can't be null
      oldFormat - true if comment should be in old format, false in new format
      isRussian - true if keywords in comment should be in Russian language, false in English
      Returns:
      string content of the created comment, never null
    • parseTemplateComment

      public static BslDocumentationProvider.DocumentContent parseTemplateComment(List<String> template, Method method, BslDocumentationProvider documentation, boolean oldFormat)
      Parses comment for method.
      Parameters:
      template - comment content by lines, cannot be null
      method - corresponding Bsl method, cannot be null
      documentation - needs for getting English name of Types, cannot be null
      oldFormat - true if comment should be in old format, false in new format
      Returns:
      content of the comment, never null
    • computeCommentLocalPosition

      public static org.eclipse.xtext.util.Triple<Integer,Integer,String> computeCommentLocalPosition(org.eclipse.jface.text.IDocument document, int globalOffSet, org.eclipse.xtext.nodemodel.INode commentStartNode)
      Computes local offset on the comment line by global offset and start comment node
      Parameters:
      document - actual document, cannot be null
      globalOffSet - global offset of the position comment part in document
      firstDocumentNode - first node of the comment content, cannot be null
      Returns:
      • line number - current line number from the beginin comment content
      • local offset - offset on the line in comment
      • line content - whole line comment content
      can return null in case globalOffSet or position of commentStartNode is a non-existing position for document