-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error updating text editor (copying lib resources) #1083
Comments
Maybe related to eclipse/xtext-xtend#166 I thought that I could add a subclass to DefaultRenameStrategy for applyDeclarationChange, but debugging show no breakpoint. Problem occurs only when you keep open files of project renamed in editor. If you close them and reopen everything works fine |
So... after debugging for 1 hour, I came with this conclusion: You rename a project, a file... so, you change context. Let's say you have a class A. Its parent is class Object. So cache resource triggers a linking process from editor. But, Object (element 5 in lang.wlk) fails when trying to get that URI in a deprecated project. If you had "project1" and you rename it to "project2", context still points to "project1": JdtClasspathUriResolver class @Override
public URI resolve(Object context, URI classpathUri) {
if (!(context instanceof IJavaElement)) {
throw new IllegalArgumentException("Context must implement IResource");
}
javaElement = (IJavaElement) context; (1)
try {
if (ClasspathUriUtil.isClasspathUri(classpathUri)) {
IJavaProject javaProject = javaElement.getJavaProject();
URI result = findResourceInWorkspace(javaProject, classpathUri); (2)
if (classpathUri.fragment() != null)
result = result.appendFragment(classpathUri.fragment());
return result;
}
}
catch (Exception exc) {
throw new ClasspathUriResolutionException(exc);
}
return classpathUri;
} So, that's why context is a java element (1), but you can't find resource in workspace any more (2). So you get the same uri as result, and caller fails subsequently: XtextResourceSet class if (ClasspathUriUtil.isClasspathUri(uri)) {
URI result = XtextResourceSet.this.resolveClasspathURI(uri);
if (ClasspathUriUtil.isClasspathUri(result))
throw new ClasspathUriResolutionException(result); What do you think @Juancete @npasserini @tesonep ? |
I think this could be a good clue: Update: no, it is useful but for refactoring issues. Currently the problem is in Rename resources, so Refactoring rename is not triggered. |
If you rename a project, change display resolution, and sometimes when you rename a method, you get
It happens apparently if you need to copy or refresh a wollok library, that is cached now.
The text was updated successfully, but these errors were encountered: