Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365848 - [xtext] validate context menu action chokes on editor for non-workspace resource
Summary: [xtext] validate context menu action chokes on editor for non-workspace resource
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 04:33 EST by Johan Wannheden CLA
Modified: 2017-04-28 14:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Wannheden CLA 2011-12-07 04:33:41 EST
Build Identifier: I20110613-1736

Given an open Xtext editor for a resource not in the workspace, executing the _Validate_ context menu action will cause current resource to be validated and an attempt to create markers will fail: the MarkerIssueProcessor seems to be instantiated with a null resource, this leading to an NPE in org.eclipse.xtext.ui.editor.validation.AddMarkersOperation#execute(IProgressMonitor).

Also, the _Rename Element_ context menu action should probably be disabled in a read-only editor.

Reproducible: Always
Comment 1 Christian Dietrich CLA 2017-04-28 14:31:21 EDT
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283086 solves the validation part of the problem.

rename fails with

java.lang.IllegalStateException: Could not determine project for context resource file:/Users/dietrich/demo.xtext
	at org.eclipse.xtext.ui.refactoring.ui.DefaultLinkedPositionGroupCalculator.getLinkedPositionGroup(DefaultLinkedPositionGroupCalculator.java:107)
	at org.eclipse.xtext.ui.refactoring.ui.RenameRefactoringController$1.run(RenameRefactoringController.java:145)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

i think there should be no validation or rename available at all