Repository navigation
SAP ADT (ABAP) editors are invisible to getOpenEditors / getCurrentSelection / getWorkspaceFolders #153
Description
Plugin version
3.2.9.202609272153
Eclipse version and OS
2026-09
What happened?
I tried to use the ClaudeCode plugin in combination with the SAP ADT plugin (https://tools.hana.ondemand.com/#abap), but unfortunately that didn't work very well. So obviously I tasked Claude to debug the problem, and here is his report (If you need more information, I will try my best to provide it):
Summary
When using the plugin with SAP ABAP Development Tools (ADT), Claude Code cannot see any open ABAP editor, the current selection, or the ABAP project:
getOpenEditors→{"editors":[]}(two ABAP editors are open)getCurrentSelection/getLatestSelection→{"text":"","isEmpty":true}(text is selected in an ABAP editor)getWorkspaceFolders→{"folders":[]}, although the log saysLock file written (Rust) for port 10000 workspace=... projects=1
The IDE connection itself works fine (lock file, port and PID match the running Eclipse). The cause is two assumptions in the Java side of the plugin that don't hold for ADT; details below.
Environment
- Plugin:
com.anthropic.claudecode.eclipse_3.2.9.202609272153 - Eclipse: 4.41 (build
4.41.0.20260903-0719), JustJ OpenJDK 25 - SAP ADT: 3.60.4 (
com.sap.adt.oo.ui_3.60.4,com.sap.adt.programs.ui_3.60.4) - OS: Windows 11
Steps to reproduce
- Install ADT and create an ABAP project connected to any SAP system.
- Open an ABAP class and an ABAP report (program) in their editors.
- Select some text in one of them.
- In Claude Code, call
getOpenEditors,getCurrentSelectionandgetWorkspaceFolders.
Expected: both editors are listed, the selection is returned, and the ABAP project shows up.
Actual: all three return empty results.
Root cause
I analysed the installed 3.2.9 jar with javap (I couldn't locate the Java sources in the repo, so class and method names below come from the bytecode).
1. ADT editors are MultiPageEditorParts, not ITextEditors
GetCurrentSelectionTool, SelectionTracker.onSelectionChanged() and SelectionTracker$PartActivationListener.partActivated() all do:
if (!(part instanceof ITextEditor)) return /* empty */;ADT's source editors are multi-page editors:
com.sap.adt.oo.ui.internal.classes.editors.MultiPageClassEditor (editor id com.sap.adt.abapClassEditor)
└ com.sap.adt.tools.abapsource.ui.sources.editors.AbapSourceMultiPageEditor
└ org.eclipse.ui.part.MultiPageEditorPart
com.sap.adt.programs.ui.internal.programs.editors.ProgramEditor (editor id com.sap.adt.programs.ui.AdtProgramEditor)
└ com.sap.adt.tools.abapsource.ui.sources.editors.AbapSourceSinglePageEditor
└ AbapSourceMultiPageEditor
└ org.eclipse.ui.part.MultiPageEditorPart
The actual text editor is the selected page (IAbapSourcePage extends ITextEditor), so the instanceof check always fails. (AbapSourceMultiPageEditor.getAdapter() does not appear to handle ITextEditor.class either.)
2. ADT files are not on the local file system
ABAP projects live in the Eclipse semantic file system. The project's location URI is semanticfs:/E10_900_user_de, so IResource.getLocation() returns null for the project and for every file in it.
EditorUtils.getFilePath(IEditorInput)returnsnullwhenIFile.getLocation()isnull.GetOpenEditorsToolsilently skips every editor whose path isnull→ empty list.SelectionTracker.onSelectionChanged()returns early when the path isnull→ selection is never tracked, even if issue 1 is fixed.GetWorkspaceFoldersToolskips projects whoseIProject.getLocation()isnull→ no folders.
Suggested fix
a) Resolve the embedded text editor (use it in GetCurrentSelectionTool, SelectionTracker and PartActivationListener):
static ITextEditor resolveTextEditor(IWorkbenchPart part) {
if (part instanceof ITextEditor te) return te;
if (part instanceof MultiPageEditorPart mp
&& mp.getSelectedPage() instanceof ITextEditor te) return te;
return part != null ? part.getAdapter(ITextEditor.class) : null;
}Selection events from a MultiPageEditorPart already arrive as ITextSelection via MultiPageSelectionProvider, so once the editor is resolved the rest of the existing logic should work. This isn't ADT-specific: it would also help other multi-page editors (PDE manifest editor, m2e POM editor, etc.).
b) Don't drop non-local resources; fall back to a URI or workspace path:
// EditorUtils.getFilePath
IFile file = fileInput.getFile();
IPath loc = file.getLocation();
if (loc != null) return loc.toOSString();
URI uri = file.getLocationURI(); // e.g. semanticfs:/E10_900_user_de/...
return uri != null ? uri.toString() : file.getFullPath().toString();Do the same in GetWorkspaceFoldersTool (fall back to getLocationURI()). Also, GetOpenEditorsTool could list an editor with its label even when no path can be resolved, instead of skipping it.
Claude Code can't read such a path from disk. Still, with (a) and (b) the open editors become visible, and getCurrentSelection returns the selected text inline, which covers the most common use case ("explain the selected method").
Possibly affected as well (not verified)
openFile, getDiagnostics, openDiff / acceptDiff and saveDocument probably make the same local-path assumption. For full ADT support, these tools would need to resolve workspace paths or semanticfs: URIs through the workspace (e.g. ResourcesPlugin.getWorkspace().getRoot().getFile(...), or findFilesForLocationURI) instead of the local file system. Since ADT sources aren't on disk, an optional tool that returns the content of an open editor's document would be useful too.
Happy to test a build against ADT if that helps.
Activity
Selections in tabbed editors such as `MANIFEST.MF`, `plugin.xml` and …
eilonwy06 commentedon Oct 3, 2026
Hello @dg-cg, please check if the latest release resolved the issue for you.
dg-cg commentedon Oct 5, 2026
Thank you, unfortunately I'm sick at the moment. I'll test it as soon as I can.
dg-cg commentedon Oct 8, 2026
Okay, I did a test of the new version now. getOpenEditors, and getLatestSelection do return a good results now.
Editing content doesn't work so well yet, though. Claude can only read the file from the local cache, and in no way interact with open editors, and the openDiff is blocked/deactivated. I/he can create a new issue for that.
LalaLolLucky commentedon Oct 21, 2026
@dg-cg thanks for the follow-up on 2026-10-08. I looked into why editing and
openDiffdon't work for ABAP files, and put out #218 for the part that can be fixed safely.Why
openDiffcan't work for ADT sources as it stands.openDiff,acceptDiffandopenFileall treat the path as a file on the local disk. For an ABAP file the only path is thesemanticfs:/…URI thatgetOpenEditorsnow reports. There is also a deeper limit: after you accept a diff the CLI writes the file itself, by path, and no path reaches the SAP system, only ADT's local cache. That matches what you saw (Claude reading and writing the cache, not the open editor).What 3.2.23 does:
openFilenow opens asemanticfs:file through the workspace, and applies the line and selection inside a multi-page editor.openDiffandacceptDiffnow refuse right away with a clear message ("… is not a file on disk … use the editor it is open in instead") instead of an obscure path error.It is unit-tested, but I have no SAP ADT to try
openFileon a real ABAP file. If you are willing, v3.2.23 would tell us whether it opens your class and report editors correctly.Still open (so this issue stays open):
getWorkspaceFolders(the third symptom in the report). Does it list your ABAP project now?openFile opens files kept by another file system; the diff tools refu…
DariusRDev commentedon Oct 26, 2026
You could look for inspiration in this repo: https://github.com/microsoft/copilot-for-eclipse. It managed to work well with ABAP.