Skip to content

Commit

Permalink
Fix typos and improve clarity in search-and-transform guide documenta…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
pelikhan committed Sep 18, 2024
1 parent d0d5176 commit 2d6fad3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/content/docs/guides/search-and-transform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar:
import { Code } from "@astrojs/starlight/components"
import source from "../../../../../packages/vscode/genaisrc/st.genai.mjs?raw"

This script is an evoluation of the "search and replace" feature from text editor,
This script is an evolution of the "search and replace" feature from text editor,
where the "replace" step has been replaced by a LLM transformation.

It can be useful to batch apply text transformations that are not easily done with
Expand All @@ -21,19 +21,19 @@ the `exec` command, we needed to convert all script using `
host.exec("cmd", ["arg0", "arg1", "arg2"])
```

to
to

```js
host.exec(`cmd arg0 arg1 arg2`)`
```

While it's possible to match this function call with a regular expression
While it's possible to match this function call with a regular expression
```regex
host\.exec\s*\([^,]+,\s*\[[^\]]+\]\s*\)
```
it's not easy to formulate the replacement string... unless you can describe it in natural language:
it's not easy to formulate the replacement string... unless you can describe it in natural language:

```txt
Convert the call to a single string command shell in TypeScript
Expand Down

0 comments on commit 2d6fad3

Please sign in to comment.