Skip to content

Commit da92dd3

Browse files
📝 Add docstrings to warp_support
Docstrings generation was requested by @tanthcstt. * #351 (comment) The following files were modified: * `MCPForUnity/Editor/Services/ClientConfigurationService.cs` * `UnityMcpBridge/Editor/Windows/ManualConfigEditorWindow.cs`
1 parent 697e0fb commit da92dd3

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

MCPForUnity/Editor/Services/ClientConfigurationService.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ public string GenerateConfigJson(McpClient client)
409409
}
410410
}
411411

412+
/// <summary>
413+
/// Provide user-facing installation and configuration steps for the specified MCP client type.
414+
/// </summary>
415+
/// <param name="client">The MCP client whose type determines which installation steps are returned.</param>
416+
/// <returns>A multiline string with step-by-step configuration instructions for the client's MCP type, or a default message if steps are not available.</returns>
412417
public string GetInstallationSteps(McpClient client)
413418
{
414419
string baseSteps = client.mcpType switch
@@ -469,6 +474,13 @@ public string GetInstallationSteps(McpClient client)
469474
"4. For local servers, Node.js (npx) or uvx must be installed\n" +
470475
"5. Save and restart Trae",
471476

477+
McpTypes.Warp =>
478+
"1. Open Warp\n" +
479+
"2. Open 'Warp Drive' — click the Warp icon in the top-left corner, or press (Ctrl + Shift + | on Windows / ⌘ + | on macOS)\n" +
480+
"3. Go to MCP Servers > Add\n" +
481+
"4. Paste the configuration JSON\n" +
482+
"5. Save",
483+
472484
_ => "Configuration steps not available for this client."
473485
};
474486

@@ -509,4 +521,4 @@ private void CheckClaudeCodeConfiguration(McpClient client)
509521
}
510522
}
511523
}
512-
}
524+
}

UnityMcpBridge/Editor/Windows/ManualConfigEditorWindow.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ public static void ShowWindow(string configPath, string configJson, McpClient mc
2626
window.Show();
2727
}
2828

29+
/// <summary>
30+
/// Renders the Manual Configuration editor UI for an MCP client, including instructions, config path and content, and copy/open actions.
31+
/// </summary>
32+
/// <remarks>
33+
/// The UI displays step-by-step guidance tailored to the client's MCP type, shows the configuration file path and configuration text (JSON or TOML), and provides buttons to copy the path or config to the system clipboard and to open the config file with the system default application. Invoking copy or open actions updates window state used for copy feedback and may launch the platform shell to open the file. This method is intended to be called by Unity's editor event loop and performs no return value.
34+
/// </remarks>
2935
protected virtual void OnGUI()
3036
{
3137
scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
@@ -115,6 +121,14 @@ protected virtual void OnGUI()
115121
instructionStyle
116122
);
117123
}
124+
else if (mcpClient?.mcpType == McpTypes.Warp)
125+
{
126+
EditorGUILayout.LabelField(
127+
"a) Open 'Warp Drive' by click the Warp icon in the top-left corner or press (Ctrl + Shift + | on Windows / ⌘ + | on macOS) > MCP Servers > Add",
128+
instructionStyle
129+
);
130+
}
131+
118132
EditorGUILayout.LabelField(" OR", instructionStyle);
119133
EditorGUILayout.LabelField(
120134
" b) Opening the configuration file at:",
@@ -300,4 +314,4 @@ protected virtual void Update()
300314
}
301315
}
302316
}
303-
}
317+
}

0 commit comments

Comments
 (0)