Skip to content

When an editor in Eclipse is an ITextEditor instance without DocumentProvider, an error message is thrown. #510

@pwtreffers

Description

@pwtreffers

Describe the bug
When an Eclipse editor has no DocumentProvider an error message is given in the UI. Although the base editor implements ITextEditor there is not always a document provider. Amazon Q plugin should not give an error message in that case. Having a DocumentProvider is not manadatory.

This is the error text:

An error has occurred. See error log for more details.
Cannot invoke "org.eclipse.ui.texteditor.IDocumentProvider.getDocument(Object)" because the return value of "org.eclipse.ui.texteditor.ITextEditor.getDocumentProvider()" is null

To Reproduce
Just implement ITextEditor in any editor class without specifying a DocumentProvider in getDocumentProvider() method.
Expected behavior
No error message, just ignore.

Screenshots

Your Environment:

  • OS: Windows
  • Eclipse product (EE, C++, etc): 2025-06
  • Eclipse product version:
  • Amazon Q for Eclipse plugin version: 2.5.0.202508271757
  • JVM version: 21

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions