public final static Location getElementLocation()

in com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/JdtlsUtils.java [50:66]


	public final static Location getElementLocation(IJavaElement element) {
		Location targetLocation = null;
		try {
			ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT);
			IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE);
			if (compilationUnit != null || (cf != null && cf.getSourceRange() != null)) {
				targetLocation = JdtlsUtils.fixLocation(element, toLocation(element),
						element.getJavaProject());
			} else if (element instanceof IMember && ((IMember) element).getClassFile() != null) {
				targetLocation = JdtlsUtils.fixLocation(element,
						toLocation(((IMember) element).getClassFile(), 0, 0), element.getJavaProject());
			}
		} catch (CoreException ex) {
		}

		return targetLocation;
	}