> ## Documentation Index
> Fetch the complete documentation index at: https://docs.windsurf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# コードレンズ

> Windsurf のコードレンズを使用して、エディタ内で関数やクラスに対する Explain、Refactor、Docstring の操作をすばやく実行できます。

<div id="explain-refactor-and-add-docstring">
  ## 説明、リファクタリング、Docstring の追加
</div>

テキストエディタ上部で、Windsurf は関数やクラスに対して「コードレンズ」を表示します。

<Frame>
  <img src="https://mintcdn.com/codeium/bVGscI7v3lPUsThV/assets/windsurf/windsurf-code-lenses.png?fit=max&auto=format&n=bVGscI7v3lPUsThV&q=85&s=741eb72a40e5ae8eca97e8e2a493bd28" width="884" height="216" data-path="assets/windsurf/windsurf-code-lenses.png" />
</Frame>

`Explain` コードレンズは Cascade を起動し、関数やクラスの役割や動作を分かりやすく説明します。

`Refactor` と `Docstring` のコードレンズは、いずれも Command を起動します。

* `Refactor` をクリックすると、Windsurf が選択可能な事前定義の指示をドロップダウンで提示します。自分で指示を記述することも可能です。これは関数を選択して Command を実行するのと同等です。
* `Docstring` をクリックすると、Windsurf は関数ヘッダーの上に docstring を生成します。
  （Python では、docstring は関数ヘッダーの「下」に正しく生成されます。）

<Frame>
  <video autoPlay muted loop playsInline src="https://mintcdn.com/codeium/bVGscI7v3lPUsThV/assets/windsurf/windsurf-refactor-code-lens.mp4?fit=max&auto=format&n=bVGscI7v3lPUsThV&q=85&s=484ec31a18bc46297583ca82ebb4a5fd" data-path="assets/windsurf/windsurf-refactor-code-lens.mp4" />
</Frame>
