# JavaScript 模板

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/go/llms.txt).

## 方法调用

搜索方法调用的最简单模板是  `$Instance$.$MethodCall$($Arguments$)` 。

![用于方法调用的搜索模板](https://resources.jetbrains.com/help/img/idea/2026.3/ws_ssr_examples_find_method_call_template.png)

查找   工具窗口显示检测到的方法调用。

![在 Find 工具窗口中的搜索结果](https://resources.jetbrains.com/help/img/idea/2026.3/ws_ssr_examples_find_method_call_results.png)

如果您需要定位具有特定参数数量的方法调用，请将插入符号放在  `$Arguments$`  变量处，并为其配置  Count  过滤器。

![带计数过滤器的方法调用搜索模板](https://resources.jetbrains.com/help/img/idea/2026.3/ws_ssr_examples_find_method_call_template_count.png)

查找   工具窗口中的搜索结果列表会缩小。

要导航到源代码中的方法调用，请在   查找   工具窗口中双击它。 GoLand 会在编辑器中打开相应的文件，并将插入符号定位到方法调用处。

![结构化搜索：跳转到源代码](https://resources.jetbrains.com/help/img/idea/2026.3/ws_ssr_examples_jump_to_source.png)

带有检测到的方法调用的源代码也会显示在   查找   工具窗口的右侧窗格中。

## JavaScript 和 Typescript 类

如果您有一个 JavaScript 或 Typescript 类  `MyClass` ：

```GO
class MyClass {}

```

那么搜索它的最简单模板是  `class $name$ {}` 。

![类的结构化搜索](https://resources.jetbrains.com/help/img/idea/2026.3/ws_ssr_examples_find_class_results.png)

## 接口的实现

如果您有一个 JavaScript 或 Typescript 接口  `MyInterface`  和一个实现它的类  `Implementation` ：

```GO
class Implementation implements MyInterface{}

```

那么搜索实现的最简单模板是  `class $Class$ implements $SomeInterface$ {}` 。

## 子类

如果您有一个 JavaScript 或 Typescript 类  `Parent`  和一个扩展它的类  `Descendant` ：

```GO
class Descendant extends Parent{}

```

那么搜索  `Descendant`  的最简单模板是  `class $Class$ extends $AnotherClass$ {}` 。

## 语句

搜索  if  语句的最简单模板是  `if($var$){$code$}` 。

结果中检测到的匹配项将显示在   查找   工具窗口中，双击您感兴趣的项以导航到源代码。 GoLand 会在编辑器中打开相应的文件，并将插入符号定位到语句处。

![结构化搜索 if 语句](https://resources.jetbrains.com/help/img/idea/2026.3/ws_structural_search_if_statement.png)

