Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Dont open hidden resources (to avoid DLTK hidden resources). Fixes #94
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-medeiros committed Feb 26, 2015
1 parent 458c317 commit 313895e
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.text.IDocument;
Expand Down Expand Up @@ -102,7 +101,11 @@ public static IEditorInput getBestEditorInputForPath(Path filePath) {
}

public static IEditorInput getBestEditorInputForUri(URI uri) {
IFile[] files = ResourceUtils.getWorkspaceRoot().findFilesForLocationURI(uri, IWorkspaceRoot.INCLUDE_HIDDEN);
return getBestEditorInputForUri(uri, IResource.NONE);
}

public static IEditorInput getBestEditorInputForUri(URI uri, int memberFlags) {
IFile[] files = ResourceUtils.getWorkspaceRoot().findFilesForLocationURI(uri, memberFlags);
if(files.length != 0) {
// As an improvement, if there is more than one file, we could try to see which one is more relevant
// instead of just using the first one.
Expand Down Expand Up @@ -165,12 +168,6 @@ public static IEditorPart openEditor(String editorId, IEditorInput newInput) thr
return page.openEditor(newInput, editorId, true, IWorkbenchPage.MATCH_NONE);
}

@Deprecated
public static ITextEditor openEditor(ITextEditor currentEditor, String editorId,
IEditorInput newInput, SourceRange sourceRange, OpenNewEditorMode openNewEditor) throws CoreException {
return openTextEditorAndSetSelection(currentEditor, editorId, newInput, openNewEditor, sourceRange);
}

public static ITextEditor openTextEditorAndSetSelection(String editorId, IEditorInput newInput,
SourceRange sourceRange) throws CoreException {
return openTextEditorAndSetSelection(null, editorId, newInput, OpenNewEditorMode.ALWAYS, sourceRange);
Expand Down

0 comments on commit 313895e

Please sign in to comment.