ek9_remove_comments

Deletes one whole-line comment block (//, <!- -!>, <!-- --> or <?- -?>) in full; answers status and edits[] (one DELETE per line), or conflicts[] (kind 'comment-shares-line-with-code') when a boundary line also carries code.

Category: Editor · Compare: IntelliJ Cmd+Shift+/ delete-block-comment / LSP code action "Remove comment"

When to use it

'Drop the //AI: comment in orders.ek9' is one call with file + symbol:'AI' (a word from the comment) or line (any line inside it) - the tool expands to the whole block. Use it on a stale whole-line comment: an acted-on instruction, or a <?- -?>/<!- -!> block whose target was removed.

When not to use it

Details

summary names the comment form removed: line-comment / block-comment / block-comment-html / doc-comment; edits are one DELETE per resolved line. A comment whose first or last line also carries code outside the delimiters returns status:'conflicts' (kind comment-shares-line-with-code).

Arguments

ArgumentTypeRequiredWhat it is
filestringyesWorkspace-relative path to the .ek9 source file containing the comment.
lineintegerAny 1-based line inside the comment - the tool expands to the full extent of the block via the ANTLR token stream. OMIT it and pass symbol:'<word>' to let the tool find the line.
symbolstringA word from the comment's text (e.g. 'AI' from '//AI: ...'); the first line carrying it as a whole word anchors the call. Pass line instead when the word also occurs in code.

It also takes the arguments every tool takes.

Recorded calls

Real calls, recorded against small projects and checked on every build - a changed answer fails it.

Remove line comment apply

Request

{
  "file" : "Hello.ek9",
  "line" : 6
}

Response

{
  "conflicts" : [ ],
  "edits" : [ {
    "before" : "      // drop me",
    "endLine" : 6,
    "file" : "Hello.ek9",
    "startLine" : 6,
    "type" : "delete"
  } ],
  "meta" : {
    "serverMs" : "<timing>"
  },
  "resolvedPath" : "<workspace-root>/Hello.ek9",
  "risk" : {
    "crossesModuleBoundary" : false,
    "estimatedSeverity" : "trivial",
    "fileCount" : 1,
    "lineCount" : 1,
    "touchesPublicApi" : false,
    "touchesTests" : false
  },
  "status" : "applied",
  "summary" : "Removed line-comment on line 6",
  "workspaceHash" : "<workspace-hash>",
...

Cut short here: 3 more lines. The whole recorded call.

See also