Skip to content
Discussion options

You must be logged in to vote

Here's my implementation which takes care of placing a SL_COMMENT that is right after a '{' node on a new line, properly indented (note: the code should also be applicable to multi-line ML_COMMENT nodes (untested)):

  /**
   * Creates hidden text edits for single-line comments after an opening brace.
   * Adjusts indentation and adds newlines as needed.
   *
   * @param previous The previous CST node.
   * @param hidden The hidden CST node (single-line comment).
   * @param formatting The formatting action.
   * @param context The formatting context.
   * @returns An array of TextEdit objects.
   */
  protected override createHiddenTextEdits(
    previous: CstNode | undefined,
    hidden: C…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@shutterfreak
Comment options

@msujew
Comment options

@shutterfreak
Comment options

@msujew
Comment options

@shutterfreak
Comment options

Comment options

You must be logged in to vote
1 reply
@goto40
Comment options

Answer selected by shutterfreak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants