Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

Token Search and Replace

Visual D features a search and replace dialog that can be used to do replacements based on the tokenizer used by Visual D for syntax highlighting. The dialog can be opened through the Visual D menu:

A token consists of the actual lexical D element and any preceding white spaces including comments. The search and replacement texts are tokenized according to the D language, matching the result against the tokenized source text ignoring syntactically unimportant text like comments and line breaks. Brace matching is supported, allowing to match nested expressions nicely.

Here is an example:

Executing 'Replace All' will exchange the arguments of all calls and declarations of function 'fun' in the current document, even if the arguments span multiple lines and include nested expressions.

The search text allows some special $ tokens:

NAME can be any alpha numeric identifier.

Any $-token used in the replacement string is replaced with the identically named capture from the matched search string. $* is relaced by the the whole matched string.