# シグネチャーの変更

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

> **TL;DR**
> `リファクタリング | シグネチャーの変更`
>
>
>
> `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `⌘ F6` (Xcode), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Ctrl+F6` (ReSharper), `⌘ F6` (ReSharper (macOS)), `Ctrl+F6` (QtCreator), `⌘ F6` (QtCreator (macOS)), `Ctrl+F6` (NetBeans), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> ショートカット: `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `⌘ F6` (Xcode), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Ctrl+F6` (ReSharper), `⌘ F6` (ReSharper (macOS)), `Ctrl+F6` (QtCreator), `⌘ F6` (QtCreator (macOS)), `Ctrl+F6` (NetBeans), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS))
>
>
>
> リファクタリング設定：  `設定 | エディター | 一般​`
>
>
>
> リファクタリングを利用できます

シグネチャーの変更 リファクタリングは、関数シグネチャーに適用できるいくつかの異なる変更を組み合わせます。 このリファクタリングを使用して、次のことができます。

* 関数名と戻り値の型を変更する

* パラメーターの追加、削除、並べ替え

関数シグネチャーを変更する際、CLion は関数のすべての使用箇所を検索し、変更に対応して安全に修正できるすべての呼び出し、実装、オーバーライド置換を更新します。

Procedure: パラメーターの追加

1. 赤色でハイライトされている  `return`  値をクリックします。

2. `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `⌥ ⏎` (Xcode), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Alt+Enter` (ReSharper), `⌥ ⏎` (ReSharper (macOS)), `Alt+Enter` (QtCreator), `⌥ ⏎` (QtCreator (macOS)), `Alt+Enter` (NetBeans), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) を押して   パラメーター「<parameter_name>」を作成する   を選択します。

3. シグネチャーの変更   ダイアログで、パラメーター設定を調整するか、提案された設定を受け入れます。

4. リファクタリング   をクリックします。

Procedure: 関数シグネチャーを変更する

1. リファクタリングする関数にキャレットを配置します。

2. `Ctrl+F6` (Windows), `⌘ F6` (macOS), `⌘ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ S` (macOS System Shortcuts), `Ctrl+F6` (XWin), `Ctrl+F6` (GNOME), `Ctrl+6` (KDE), `Ctrl+F6` (Emacs), `Ctrl+F6` (Sublime Text), `Ctrl+F6` (Sublime Text (macOS)), `⌘ F6` (Xcode), `Ctrl+R, S` (Visual Studio), `⌘ R, S` (Visual Studio (macOS)), `Ctrl+F6` (ReSharper), `⌘ F6` (ReSharper (macOS)), `Ctrl+F6` (QtCreator), `⌘ F6` (QtCreator (macOS)), `Ctrl+F6` (NetBeans), `Alt+Shift+C` (Eclipse), `⌘ ⌥ C` (Eclipse (macOS)) を押すか、メインメニューまたはコンテキストメニューから  `リファクタリング | シグネチャーの変更​`  を選択します。

3. シグネチャーの変更   ダイアログで、関数シグネチャーに必要な変更を加えます。

* 命名方法名 フィールドの関数名を変更します。

* 戻り値の型 フィールドで関数の戻り値の型を変更します。

* テーブルと ![追加](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) / ![削除](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.remove.svg) / ![Move up](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.arrowUp.svg) / ![Move down](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.arrowDown.svg) ボタンを使用して、関数パラメーターを管理します。 パラメーターを追加するときは、対応する行に新しいパラメーターのプロパティを指定します: タイプ 、 命名方法名 、 デフォルト値 。 デフォルト値 フィールドは、使用箇所の引数として使用される型の値を設定します。 このフィールドを空のままにすると、CLion はデフォルトの型値を使用します（たとえば、数値の場合は `0` 、ポインターの場合は `nullptr` ）。 ![シグネチャーの変更ダイアログ](https://resources.jetbrains.com/help/img/idea/2026.3/cl_change_signature_default.png) > **Note:** > [完了](auto-completing-code.html)は、 タイプ および デフォルト値 フィールドで使用できます。

* 対応するチェックボックスを使用して、関数 `const` 、 `constexpr` 、または `noexcept` を作成することもできます。

## サンプル例

C/C++:

|  前  |  後  |
| --- | --- |
|     ```CPLUSPLUS //Initial function signature int exFunction2(int a, int b) {     int x = a+b;     return x; };  int main() {     int a = 0, b = 1;     int x = exFunction2(a, b);     return 0; }  ```    |     ```CPLUSPLUS //Name changed, the third parameter introduced int exFunction3(int a, int b, int c) {     int x = a+b;     return x; };  int main() {     int a = 0, b = 1;     int x = exFunction3(a, b, 0); //default value '0' added     return 0; }  ```    |

Python:

|  前  |  後  |
| --- | --- |
|     ```PYTHON # This function will be renamed def fibonacci( n ): a, b = 0, 1 while b < n: print( b ) a, b = b, a+b  n = int(input("n = ")) fibonacci( n )  ```    |     ```PYTHON # Function with the new name def fibonacci_numbers( n ): a, b = 0, 1 while b < n: print( b ) a, b = b, a+b  n = int(input("n = ")) fibonacci_numbers( n )  ```    |

JavaScript:

|  前  |  後  |
| --- | --- |
|     ```JAVASCRIPT //This function will be renamed //and a default parameter will be added function result() { }  function show_result() {     alert('Result: ' + result()); }   ```    |     ```JAVASCRIPT //Function with a new name and default parameter function generate_result(input = 100) { }  function show_result() {     alert('Result: ' + generate_result()); }  ```    |

## See also

### 外部リンク

[JetBrains CLion Blog](http://blog.jetbrains.com/clion/2014/12/refactorings-in-clion-be-safe-and-quick/)

