#292 ResourceException while opening perl script outside project

v0.5.x
open
nobody
Editor (234)
5
2006-11-04
2006-08-28
wyuenho
No

I have a file called fixperm.pl sitting in my home
directory. When I tried to open it from Eclipse as is
(File -> Open File...), I got this:

org.eclipse.core.internal.resources.ResourceException:
/Users/yhwong is not a valid location for linked resources.

eclipse.buildId=M20060629-1905
java.version=1.5.0_06
java.vendor=Apple Computer, Inc.
BootLoader constants: OS=macosx, ARCH=ppc, WS=carbon,
NL=en_US
Framework arguments: -keyring
/Users/yhwong/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws carbon -keyring
/Users/yhwong/.eclipse_keyring -consoleLog -showlocation
This is a continuation of log file
/Users/yhwong/Documents/workspace/.metadata/.bak_0.log
Created Time: 2006-08-28 14:53:35.848

Error
Mon Aug 28 15:11:02 EDT 2006
An unexpected exception occurred while creating a link
to /Users/yhwong/fixperm.pl

org.eclipse.core.internal.resources.ResourceException:
/Users/yhwong is not a valid location for linked resources.
at
org.eclipse.core.internal.resources.Resource.assertLinkRequirements(Resource.java:154)
at
org.eclipse.core.internal.resources.Resource.createLink(Resource.java:588)
at
org.eclipse.core.internal.resources.Resource.createLink(Resource.java:570)
at
org.epic.core.util.FileUtilities.createFolderLink(FileUtilities.java:86)
at
org.epic.core.util.FileUtilities.getFileEditorInput(FileUtilities.java:27)
at
org.epic.perleditor.editors.PerlEditor.doSetInput(PerlEditor.java:181)
at
org.eclipse.ui.texteditor.AbstractTextEditor$17.run(AbstractTextEditor.java:2396)
...

I'm running MacOSX 10.4.7 Eclipse 3.2. Also, this
action also causes a project called epic_links. This is
not a behavior comforming to the Open File... dialog in
Eclipse 3.2. Last note, this bug happens under any
perspective, not just EPIC.

Discussion

  • Jan Ploski
    Jan Ploski
    2006-11-04

    Logged In: YES
    user_id=86907

    It turns out it's not a bug in Eclipse, it's a feature (or rather an inherent limitation). We could in
    theory open files located anywhere, but it would be pretty useless because markers for error messages can
    only be attached to "resources", that is, files which have a representation in the workspace. The workaround
    used by EPIC is to create links to external files from within the "epicLinks" project (thus, before a file
    is opened, it becomes a "resource"). Unfortunately, the Eclipse platform cannot create links to files which
    reside anywhere on the path leading to the current workspace. In your case, the workspace is under the home
    directory and you are trying to open a file in the home directory - impossible, sorry.

     
  • Jan Ploski
    Jan Ploski
    2006-11-04

    • summary: ResourceException while openning perl script outside project --> ResourceException while opening perl script outside project
    • status: open --> closed-wont-fix
     
  • wyuenho
    wyuenho
    2006-11-04

    Logged In: YES
    user_id=1238261

    I'm aware of this inherent limitation and I'm not asking the
    ability to open and edit this file like a regular resource
    in an eclipse project in the workspace. As I said, this open
    file behavior needs to conform to the general eclipse
    behavior, and letting exceptions to explode in the user's
    face without any explanation is not one of them. There is a
    very good reason for the tools from the eclipse projects to
    just open a file and use the appropriate editor associated
    with the file suffix to do simple syntax highlighted
    editing, it is exactly because of this workaround doesn't
    quite do what you expect.

    I mean, from an end-users's perspective, why can't he open a
    file in a location along the path to the workspace? It
    simply makes no sense. Besides, a general eclipse user used
    to the behavior of the open file command of the official
    eclipse tools, will expect any other plugin will simply do
    just that, which is just open that file and have some
    minimal editing capability. Meaning - the user wants exactly
    that behavior. As a result, anything that does not do just
    that will be considered intrusive. In this case, it is
    especially intrusive in that the user did not ask for a new
    project to be created in the workspace but EPIC did that
    anyway, and the project won't go away when the user closes
    the file.

    Generally, good software and malware differs in that good
    software does exactly what the user asks for, nothing more
    and nothing less.

     
  • wyuenho
    wyuenho
    2006-11-04

    • status: closed-wont-fix --> open
     
  • Jan Ploski
    Jan Ploski
    2006-11-04

    Logged In: YES
    user_id=86907

    I consider the epicLinks story a minor annoyance, which even has some side benefits (syntax validation works
    for external files) and definitely makes implementation easier to understand. Thus, I concede that there are
    more important bugs to fix and features to implement. If you think otherwise, you are welcome to provide a
    patch for this one. Before doing that, please take care to provide unit tests that demonstrate that the code
    works as expected after your contribution. You could also convince Eclipse people that being unable to
    create links to files on the path to the workspace is not what you expect as a developer.

    I committed an improved error message for this bug to CVS.