Coder
Coder is a set of components for creating and manipulating code.
Method coder
The smallest unit is the GtPharoMethodCoder
which, as the name says, focuses on editing one single method.
![](gt-figures/1507.png)
The method coder can mold dynamically to fit the context of the current method. For example, when the method is annotated with <gtExample>
, the coder is embellished with the possibility to run the method as an example, and see the result as a label. This happens dynamically. Give it a try below.
![](gt-figures/1508.png)
Filters
Method coders can be combined in different ways for different purposes. One of these purposes is searching. This is achieved by means of GtSearchMethodsFilter
.
For example, below you see the result of a code query. Expanding the resulting method coders highlights the specific nodes that matched the query.
gtExamplePragmas <gtExample> | filter | filter := #gtExample gtPragmas. self assert: filter notEmpty. self assert: (filter matches: thisContext method). ^ filter
![](gt-figures/1509.png)
See GtSearchMethodFilterExamples
for more details.