Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
This repository was archived by the owner on May 6, 2020. It is now read-only.

ReverseSourceLookup.wrapNonVirtualContainer is out of sync with SourceNameMapperContainer.findSourceElements when using a WorkspaceSourceContainer #92

Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
SDK/Debugger version: 0.3.9 (current checked trunk out)
Eclipse version: 3.7.2
Google Chrome/V8 Embedder + version: N/A
[For WebKit (WIP) protocol] Backend version: N/A
OS + version:

What steps will reproduce the problem?
I have a source mapper configured with Workspace scope.
because my urls are like this:

http://localhost:8080/test/test.js
http://localhost:8080/test2/test.js

the prefix is http://localhost:8080 (i can't use the extra slash because then 
setting breakpoints wants to send it to: http://localhost:8080//test/test.js so 
with an extra /)

the ReverseSourceLookup works perfect because /test/test.js on the workspace:

if (container instanceof WorkspaceSourceContainer) {
      return new ContainerWrapper() {
        @Override
        public String lookup(IFile resource) {
          return lookupInResourceContainer(resource, ResourcesPlugin.getWorkspace().getRoot());
        }
      };

when using that code so the resource == /test/test.js and the workspace root is 
really the workspace root then it finds my file correctly

But the implementation of WorkspaceSourceContainer is really that it 
genererates ProjectSourceContainers and ask the project source container on its 
name so it expects "test.js" 
I think this is kind of a bug in eclipse. because thats not what i ask for.. I 
don't say that i want to search relative to a project, i want to search 
relative to the workspace root...

But the problem is that the reverse lookup does it how i expect it to behave 
but the other way around (when the breakpoint is hit) then it can't find it.

i patched it in SourceNameMapperContainer.findSourceElements

i added this part inside that method:

 String shortName = name.substring(prefix.length());
    if (targetContainer instanceof WorkspaceSourceContainer) {
         IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(Path.fromOSString(shortName));
         if (file != null && file.exists()) return new Object[] {file};
    }

then it behaves the same and the source is found.


Original issue reported on code.google.com by [email protected] on 12 Sep 2013 at 3:21

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions