From 1dc933b123ffdcfc2edc0e5394f4d64a94a35637 Mon Sep 17 00:00:00 2001 From: Hussam Lawen Date: Sun, 10 Mar 2024 12:58:52 +0200 Subject: [PATCH] Update similar_code.md --- docs/docs/tools/similar_code.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/docs/tools/similar_code.md b/docs/docs/tools/similar_code.md index 262e39c9..a35111d7 100644 --- a/docs/docs/tools/similar_code.md +++ b/docs/docs/tools/similar_code.md @@ -24,6 +24,24 @@ Search result link example: ## How to use +### Manually +To invoke the `similar code` tool manually, comment on the PR: +``` +/find_similar_component COMPONENT_NAME +``` +Where `COMPONENT_NAME` should be the name of a code component in the PR (class, method, function). + +If there is a name ambiguity, there are two configurations that will help the tool to find the correct component: + +- `--pr_find_similar_component.file`: in case there are several components with the same name, you can specify the relevant file. +- `--pr_find_similar_component.class_name`: in case there are several methods with the same name in the same file, you can specify the relevant class name. + +example: +``` +/find_similar_component COMPONENT_NAME --pr_find_similar_component.file=FILE_NAME +``` + +### Automatically (via Analyze table) It can be invoked automatically from the analyze table, can be accessed by: ``` /analyze