|
| 1 | +# Support Delegating Read Directory to IDE |
| 2 | + |
| 3 | +## Overview |
| 4 | +Verify that Copilot Agent mode can satisfy language-server `workspace/readDirectory` requests by delegating |
| 5 | +directory listing to Eclipse. This matters for ABAP support because ADT resources may use Eclipse-managed or virtual |
| 6 | +URIs that the Copilot language server cannot list directly from the local file system. |
| 7 | + |
| 8 | +Entry points: |
| 9 | +- Window -> Show View -> Other... -> Copilot -> Copilot Chat -> Agent mode |
| 10 | + |
| 11 | +Not exercised: |
| 12 | +- General file and text search delegation, which is covered by the separate search delegation task. |
| 13 | +- Manual unit-level invocation of `workspace/readDirectory`; this plan verifies the user-visible Agent flow. |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +- Eclipse IDE with the GitHub Copilot for Eclipse plugin installed and activated. |
| 20 | +- The user is signed in to GitHub Copilot and Agent mode is available in the Copilot Chat view. |
| 21 | +- ABAP Development Tools is installed and connected to an ABAP system. |
| 22 | +- The workspace contains an imported ABAP project that has previously cached at least one ABAP development object |
| 23 | + locally (i.e., the object has been opened from Project Explorer at least once so the `.adt/...` workspace folder |
| 24 | + contains a corresponding `IFolder`/`IFile` for it). |
| 25 | +- A folder under the project's locally cached ADT structure (e.g., `<project>/.adt/classlib/classes/<class_name>/`) is |
| 26 | + visible in Project Explorer with the **Show Hidden Resources** filter disabled, and has at least one child entry on |
| 27 | + disk. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## 1. ABAP ADT directory delegation |
| 32 | + |
| 33 | +### TC-001: Agent lists a cached ADT directory through Eclipse |
| 34 | + |
| 35 | +**Type:** `Happy Path` |
| 36 | +**Priority:** `P0` |
| 37 | + |
| 38 | +> Note: Virtual ABAP packages shown in Project Explorer are not Eclipse `IResource`s, and ADT only materializes |
| 39 | +> development objects under `<project>/.adt/...` after they are opened. The delegated `workspace/readDirectory` |
| 40 | +> implementation lists workspace resources, so this test targets a *cached* ADT folder where children are guaranteed to |
| 41 | +> exist on disk. |
| 42 | +
|
| 43 | +#### Preconditions |
| 44 | +- The Eclipse workbench is open with the ABAP project loaded and connected. |
| 45 | +- A locally cached ADT folder (e.g., `<project>/.adt/classlib/classes/<class_name>/`) is visible in Project Explorer |
| 46 | + and contains at least one cached child entry (a sub-folder or a development object file such as `<name>.aclass`). |
| 47 | +- Copilot Chat is open in a fresh or cleared conversation. |
| 48 | + |
| 49 | +#### Steps |
| 50 | +1. Open **Copilot Chat** from `Window -> Show View -> Other... -> Copilot -> Copilot Chat`. |
| 51 | +2. Switch the chat mode selector to **Agent**. |
| 52 | +3. In Project Explorer, expand the target ABAP project and create a folder under it. |
| 53 | +4. Attach that folder to the chat context (drag-and-drop into the input area or use **Add Context...**) so Copilot |
| 54 | + sends its workspace URI to the language server. |
| 55 | +5. Send a prompt that asks Agent mode to list its immediate children, for example: |
| 56 | + `List the immediate children of the attached folder. Do not search recursively.` |
| 57 | +6. If Copilot asks for tool confirmation, approve the requested workspace read operation. |
| 58 | +7. Wait for the Copilot response to complete. |
| 59 | +8. Compare the listed entries in the response with the immediate children visible under the same folder in Project |
| 60 | + Explorer. |
| 61 | + |
| 62 | +#### Expected Result |
| 63 | +- Copilot completes the request without reporting that the folder URI, ADT resource, `platform:/resource` URI, or |
| 64 | + `semanticfs:` URI cannot be read. |
| 65 | +- The response includes the immediate child entries that are visible on disk for the attached cached ADT folder. |
| 66 | +- The response does not include recursive grandchildren when the prompt requested immediate children only. |
| 67 | +- The Eclipse error log has no `workspace/readDirectory`, `Invalid container URI`, or `Failed to read directory` error |
| 68 | + for the selected ABAP resource. |
| 69 | + |
| 70 | +#### Key Screenshots |
| 71 | +- [ ] **Cached ADT folder in Project Explorer** -- The selected folder expanded to show the child entries used as the |
| 72 | + expected result. |
| 73 | +- [ ] **Agent prompt** -- Copilot Chat in Agent mode with the folder attached and the listing prompt visible. |
| 74 | +- [ ] **Completed Agent response** -- The completed response showing the matching child entries. |
| 75 | + |
| 76 | +#### Notes on failure modes |
| 77 | +- Copilot says the directory cannot be read or is unsupported -- Eclipse may not be resolving the ADT, |
| 78 | + `platform:/resource`, or `semanticfs:` URI through the delegated `workspace/readDirectory` path. |
| 79 | +- The response is empty while Project Explorer shows children -- the IDE may have returned no accessible `IContainer` |
| 80 | + for the resource; verify the URI scheme is among the supported schemes (`PlatformUtils.getSupportedUriSchemes()`), |
| 81 | + the ABAP project is connected, and the target folder is genuinely cached on disk (a virtual ABAP *package* will |
| 82 | + legitimately return empty because it is not an `IResource`). |
| 83 | +- The response includes unrelated workspace files -- the language server may have fallen back to local filesystem |
| 84 | + listing instead of the Eclipse workspace resource. |
| 85 | + |
| 86 | +### TC-002: Agent handles an empty or inaccessible ABAP package without crashing |
| 87 | + |
| 88 | +**Type:** `Edge Case` |
| 89 | +**Priority:** `P1` |
| 90 | + |
| 91 | +#### Preconditions |
| 92 | +- The Eclipse workbench is open with the ABAP project loaded. |
| 93 | +- An empty ABAP package, a package with no visible child resources, or a package that can be temporarily |
| 94 | + disconnected/unloaded is available. |
| 95 | +- Copilot Chat is open in Agent mode. |
| 96 | + |
| 97 | +#### Steps |
| 98 | +1. In Project Explorer, locate the empty, unloaded, or inaccessible ABAP package and note its displayed name. |
| 99 | +2. Ask Agent mode to list the immediate children of that ABAP package. |
| 100 | +3. If Copilot asks for tool confirmation, approve the requested workspace read operation. |
| 101 | +4. Wait for the response to complete. |
| 102 | +5. Open the Eclipse error log and check for errors emitted during the request. |
| 103 | + |
| 104 | +#### Expected Result |
| 105 | +- Copilot completes the turn and explains that no child entries are available, or that the resource could not be accessed, without hanging or crashing the chat view. |
| 106 | +- No error dialog is shown to the user. |
| 107 | +- The Eclipse error log has no uncaught exception or stack trace from `workspace/readDirectory` or directory URI parsing. |
| 108 | + |
| 109 | +#### Key Screenshots |
| 110 | +- [ ] **Empty or inaccessible ABAP package** -- Project Explorer showing the package state before the prompt. |
| 111 | +- [ ] **Graceful Agent response** -- Copilot Chat showing a completed response without a crash or endless spinner. |
| 112 | + |
| 113 | +#### Notes on failure modes |
| 114 | +- The chat turn remains in progress indefinitely -- the `workspace/readDirectory` request may not be completing for unresolved ADT resources. |
| 115 | +- An error dialog or stack trace appears -- URI handling should return an empty directory result for unresolved resources instead of surfacing an exception. |
0 commit comments