# Eclipse Analyze

> Analyze Java code using Eclipse JDT tools — type hierarchy, find references, call hierarchy, compilation errors, quick fixes, and import suggestions. Use this to understand code structure before making changes. Use when this capability is needed.

- Skill: `tomevault-io/eclipse-analyze` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/eclipse-analyze`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/eclipse-analyze/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/eclipse-analyze

---


# Eclipse Code Analysis

Analyze Java code using Eclipse's JDT (Java Development Tools) infrastructure. These tools provide accurate, compiler-level analysis — not text-based guessing.

## Reading Code Efficiently

These tools are designed to minimize context window usage. Follow the **outline-first** pattern:

1. **getClassOutline** — Start here. Returns class declaration, field declarations, method signatures (no bodies), and inner types — all with line numbers. A 500-line class becomes ~30 lines. Provide `fullyQualifiedClassName`. Set `includeFields=false` to omit fields.

2. **getMethodSource** — After seeing the outline, read only the methods you need. Accepts comma-separated `methodNames` (e.g., `"save,findById,delete"`). Returns source with line numbers. Set `includeJavadoc=false` to skip doc comments. Use `methodSignature` to disambiguate overloads (e.g., `"String"` matches methods with a String parameter).

3. **getFilteredSource** — Middle ground: returns the full source but collapses methods you don't need to their signatures. Provide `methodNames` to expand specific methods; all others are shown as one-line signatures with line ranges. Set `excludeImports=true` (the default) to collapse the import block. Line numbers always match the original file for accurate editing.

4. **getSource** — Full source dump. Use only for small classes or when you need everything. Prefer the tools above to save context.

5. **readProjectResource** — Read any file by path. Supports `startLine`/`endLine` for ranges, `showLineNumbers=true` for editing, and `excludeImports=true` to collapse Java import blocks.

### Choosing the Right Tool

| Scenario | Tool | Why |
|----------|------|-----|
| Understand class structure | `getClassOutline` | Signatures only, ~90% smaller |
| Read 1-3 specific methods | `getMethodSource` | Surgical reads with line numbers |
| Read class but focus on 2 methods | `getFilteredSource` | Full context, collapsed noise |
| Small class (<100 lines) | `getSource` | Overhead not worth optimizing |
| Non-Java file or specific line range | `readProjectResource` | Works with any file type |

## Navigation & Understanding

- **getTypeHierarchy** — Show supertypes, implemented interfaces, and subtypes for a class.
- **findReferences** — Find all usages of a type, method, or field across the workspace. Essential before renaming or deleting.
- **getMethodCallHierarchy** — Show callers and callees of a method. Use `methodSignature` for overloaded methods.
- **getJavaDoc** — Get JavaDoc for a compilation unit by fully qualified name.

## Error Analysis

- **getCompilationErrors** — Get all compilation errors/warnings. Filter by `projectName` and `severity` (ERROR, WARNING, ALL).
- **getQuickFixes** — Get available quick fixes for errors in a file. Optionally filter by `lineNumber`.
- **getImportSuggestions** — Find import candidates for unresolved types.

## Project Navigation

- **getProjectLayout** — File/folder structure. Use `scopePath` and `maxDepth` for large projects.
- **getProjectProperties** — Java version, source folders, output location, natures.
- **listProjects** — All workspace projects with their natures.
- **getProjectDependencies** — Maven dependencies for a project.

## Search

- **fileSearch** — Plain text search across workspace files. Filter with `fileNamePatterns`.
- **fileSearchRegExp** — Regex search across workspace files.
- **findFiles** — Find files by glob patterns (e.g., `*.xml`, `pom.xml`).

## Editor Context

- **getCurrentlyOpenedFile** — Get the file currently active in the Eclipse editor.
- **getEditorSelection** — Get the currently selected text/lines in the active editor.

## Recommended Workflow

1. Orient: `listProjects` or `getProjectLayout` to find what you need
2. Outline: `getClassOutline` to understand class structure
3. Focus: `getMethodSource` to read specific methods, or `getFilteredSource` for full-but-collapsed view
4. Analyze: `getTypeHierarchy`, `findReferences`, `getMethodCallHierarchy` as needed
5. After edits: `getCompilationErrors` to verify, then `getQuickFixes` or `getImportSuggestions` to resolve

---
> Source: [gradusnikov/eclipse-chatgpt-plugin](https://github.com/gradusnikov/eclipse-chatgpt-plugin) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-07-01 -->

