ek9_search_text

Answers first: matchCount, files[], sites['file.ek9:LINE'] (truncated:true first when cut), then matches[{file,line,column,snippet}] - a literal or regex grep across the workspace with EK9-aware exclusions (build outputs, .ek9-cache/, dot-directories).

Category: Enquiry · Compare: ripgrep / grep / Find in Files

When to use it

You want every place a piece of TEXT or a regex appears across workspace files - one call with query:'TODO'; add pathPattern:'**/*.ek9' or path to bound it. Comments, strings, README mentions, config keys - when no symbol name or file path is known.

When not to use it

Details

Pure lexical grep — never consults symbol tables or the AST, so identical results regardless of compile state; requires watched roots (run ek9_compile first). Literal mode matches EK9 operators (<=> ? :=?) verbatim with no escaping; regex mode needs a valid java.util.regex.Pattern. caseSensitive defaults to true when the query is an identifier containing an uppercase letter (a symbol name) and false otherwise; pass it explicitly to override. path bounds the root (a directory, or a single file to search only it), pathPattern filters within it (intersection, cannot un-exclude); maxResults default 100 max 1000 - a cut result opens with truncated:true and matchTotal. column is 0-based, the base every EK9 tool uses.

Arguments

ArgumentTypeRequiredWhat it is
caseSensitivebooleanOmit it: an identifier with an uppercase letter (a symbol name) is searched case-sensitively, anything else case-insensitively. Set it to override.
includeHiddenbooleanWhen true, includes dot-files and otherwise-excluded build directories in the scan.
isRegexbooleanWhen true, query is parsed as a java.util.regex.Pattern.
maxResultsintegerCap on matches[] (default 100, max 1000). A cut result opens with truncated:true and matchTotal (the true count).
pathstringBounds the search: a workspace-relative directory, or ONE file to search just that file ('m04.ek9'). Defaults to the workspace root.
pathPatternstringOptional glob restricting which files are searched, applied relative to path (e.g. "**/*.ek9", "src/main/**"). Intersects with default exclusions — cannot bring back excluded paths.
querystringyesLiteral text (default) or regex pattern (when isRegex:true). Literal mode matches special characters verbatim — no escaping needed for operators like <=> ? :=? * ( ) [ ] \.
verbositystring: full | summary | nonefull (default) returns matches[] records; summary keeps the headline only (files, sites, counts); none collapses the lists to counts.

Recorded calls

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

Search bounded to one file

Request

{
  "path" : "MyRecord.ek9",
  "query" : "MyRecord"
}

Response

{
  "caseSensitive" : true,
  "fileCount" : 1,
  "files" : [ "MyRecord.ek9" ],
  "isRegex" : false,
  "matchCount" : 1,
  "matches" : [ {
    "column" : 4,
    "file" : "MyRecord.ek9",
    "line" : 5,
    "snippet" : "    MyRecord"
  } ],
  "meta" : {
    "serverMs" : "<timing>"
  },
  "query" : "MyRecord",
  "sites" : [ "MyRecord.ek9:5" ],
  "status" : "ok"
}

Search literal finds match

Request

{
  "caseSensitive" : true,
  "query" : "MyRecord"
}

Response

{
  "caseSensitive" : true,
  "fileCount" : 1,
  "files" : [ "MyRecord.ek9" ],
  "isRegex" : false,
  "matchCount" : 1,
  "matches" : [ {
    "column" : 4,
    "file" : "MyRecord.ek9",
    "line" : 5,
    "snippet" : "    MyRecord"
  } ],
  "meta" : {
    "serverMs" : "<timing>"
  },
  "query" : "MyRecord",
  "sites" : [ "MyRecord.ek9:5" ],
  "status" : "ok"
}