diff --git a/.gitbook/assets/find-method-usage-openrewrite.png b/.gitbook/assets/find-method-usage-openrewrite.png new file mode 100644 index 00000000..5e2ba56a Binary files /dev/null and b/.gitbook/assets/find-method-usage-openrewrite.png differ diff --git a/.gitbook/assets/find-method-usage-result.png b/.gitbook/assets/find-method-usage-result.png index 8c15a0f6..75742408 100644 Binary files a/.gitbook/assets/find-method-usage-result.png and b/.gitbook/assets/find-method-usage-result.png differ diff --git a/.gitbook/assets/find-method-usage-results.png b/.gitbook/assets/find-method-usage-results.png index 0f51fa65..d22ded02 100644 Binary files a/.gitbook/assets/find-method-usage-results.png and b/.gitbook/assets/find-method-usage-results.png differ diff --git a/.gitignore b/.gitignore index 9f11b755..0a955085 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea/ +.vscode/ \ No newline at end of file diff --git a/user-documentation/introduction-to-type-aware-code-search.md b/user-documentation/introduction-to-type-aware-code-search.md index c98e38b4..c42760de 100644 --- a/user-documentation/introduction-to-type-aware-code-search.md +++ b/user-documentation/introduction-to-type-aware-code-search.md @@ -10,7 +10,7 @@ To help you get accustomed to Moderne's search capabilities, in this guide, we w ## Using a search recipe -As an example, let's say you are wanting to find all of the places that use the `createFile` method from `java.nio.file.Files` in your code base. To begin this search: +As an example, let's say that you are wanting to find all of the places where your team is using the `createTempFile` method from `java.io.File`. If you searched for `createTempFile` in GitHub, you might end up with a ton of irrelevant results as this is a fairly common method name. To find results that match the method name _and_ are from the correct library please follow these steps: * From the [Java Search](https://public.moderne.io/catalog/org.openrewrite.java.search) page, scroll down and click on `Find method usages`. You will see this: @@ -20,23 +20,23 @@ As an example, let's say you are wanting to find all of the places that use the * Click on `Select Repositories`. * Press `Add Filter`. * Select what you want to filter on such as `Organization`. - * Type the text you want to search for such as `eclipse`. You should see the repositories filter down as desired. + * Type the text you want to search for such as `openrewrite`. You should see the repositories filter down as desired. * Press the `>>` button to select all of the filtered repositories. * Click out of the modal to confirm your choices. -* Enter the fully qualified class name of `java.nio.file.Files` in the receiver type field. -* Enter the method name of `createFile` in the method name field. +* Enter the fully qualified class name of `java.io.File` in the receiver type field. +* Enter the method name of `createTempFile` in the method name field. * Enter `..` in the argument type field to denote that we want to search for any amount of arguments. * Select `none` for the flow. * Your window should look like: - ![](../.gitbook/assets/find-method-usage-eclipse.png) + ![](../.gitbook/assets/find-method-usage-openrewrite.png) * Press `Dry Run` to begin the search. You will be redirected to a page that looks like: ![](../.gitbook/assets/find-method-usage-results.png) -* If you click on one of the repository names such as `eclipse/jkube`, you'll be taken into the code for that repository. Lines that match the search will be underlined and marked with a magnifying glass icon. These lines match the type that was specified in the search. This means that if any other `createFile` method was invoked, you wouldn't see those results here. Instead, you will see: +* If you click on one of the repository names such as `openrewrite/recipe-examples`, you'll be taken into the code for that repository. Lines that match the search will be underlined and marked with a magnifying glass icon. These lines match the type that was specified in the search. This means that if any other `createTempFile` method was invoked, you wouldn't see those results here. Instead, you will see: ![](../.gitbook/assets/find-method-usage-result.png)