@Nullable
	private static AssemblyResolution resolveAt(int position, @Nullable ASTClass parentClassDec, @Nonnull List<ASTElement> ast) {
		// Example JASM snippet for reference:
        /*
        .super java/lang/Object
        .annotation TestAnnotation {
            number: 15,
            subAnnotation: .annotation org/jetbrains/annotations/NotNull {
                value: "Hello, world!"
            },
            stringArray: { "one", "two", "three" }
        }
        .inner private static {
            name: InnerClass,
            inner: Example$InnerClass,
            outer: Example
        }
        .class public super Example {
            .method public exampleMethod (LExample;)LExample; {
                parameters: { this, other },
                exceptions: { { A, A, B, * } },
                code: {
                A:
                    aload this
                    areturn
                B:
                }
            }
        }
        */
		for (ASTElement child : ast) {
			Range range = child.range();
			if (range != null && range.within(position)) {
				if (child instanceof ASTMethod method) {
					ASTElement selectedParameter = get(position, method.parameters());
					if (selectedParameter != null)
						return new VariableDeclarationResolution(parentClassDec, method, (ASTIdentifier) selectedParameter);

					for (ASTException exception : method.exceptions()) {
						ASTElement selectedLabel = get(position, List.of(exception.start(), exception.end(), exception.handler()));
						if (selectedLabel != null)
							return new LabelReferenceResolution(parentClassDec, method, (ASTIdentifier) selectedLabel);
						ASTElement selectedType = get(position, List.of(exception.exceptionType()));
						if (selectedType != null && selectedType.content().charAt(0) == '*')
							return new TypeReferenceResolution(parentClassDec, method, (ASTIdentifier) selectedType);
					}

					ASTElement selectedAnno = get(position, method.getVisibleAnnotations());
					if (selectedAnno != null)
						return new MethodAnnotationResolution(parentClassDec, method, (ASTAnnotation) selectedAnno);
					selectedAnno = get(position, method.getInvisibleAnnotations());
					if (selectedAnno != null)
						return new MethodAnnotationResolution(parentClassDec, method, (ASTAnnotation) selectedAnno);

					ASTElement selectedInstruction = get(position, method.code().instructions());
					if (selectedInstruction instanceof ASTLabel label)
						return new LabelDeclarationResolution(parentClassDec, method, label);
					else if (selectedInstruction != null) {
						// TODO: Some instructions may reference labels, and we'll want to support those cases here
						//  - jumps
						//  - switch

						// TODO: Some instructions may reference variables as well

						// TODO: Some instructions may have type references, method handles, etc

						ASTInstruction insn = (ASTInstruction) selectedInstruction;
						return new InstructionResolution(parentClassDec, method, insn);
					}

					return new MethodResolution(parentClassDec, method);
				} else if (child instanceof ASTField field) {
					ASTElement selectedAnno = get(position, field.getVisibleAnnotations());
					if (selectedAnno != null)
						return new FieldAnnotationResolution(parentClassDec, field, (ASTAnnotation) selectedAnno);
					selectedAnno = get(position, field.getInvisibleAnnotations());
					if (selectedAnno != null)
						return new FieldAnnotationResolution(parentClassDec, field, (ASTAnnotation) selectedAnno);

					return new FieldResolution(parentClassDec, field);
				} else if (child instanceof ASTClass klass) {
					ASTElement selectedInterface = get(position, klass.getInterfaces());
					if (selectedInterface != null)
						return new ClassImplements(klass, (ASTIdentifier) selectedInterface);

					ASTElement selectedInner = get(position, klass.getInners());
					if (selectedInner != null)
						return new InnerClassResolution(klass, (ASTInner) selectedInner);

					ASTElement selectedAnno = get(position, klass.getVisibleAnnotations());
					if (selectedAnno != null)
						return new ClassAnnotationResolution(klass, (ASTAnnotation) selectedAnno);
					selectedAnno = get(position, klass.getInvisibleAnnotations());
					if (selectedAnno != null)
						return new ClassAnnotationResolution(klass, (ASTAnnotation) selectedAnno);

					ASTIdentifier superName = klass.getSuperName();
					if (superName != null && superName.range().within(position))
						return new ClassExtends(klass, superName);

					// Recurse for declared fields/methods
					return resolveAt(position, klass, klass.contents());
				} else if (child instanceof ASTAnnotation anno) {
					return new IndependentAnnotationResolution(anno);
				}
			}
		}
		return null;
	}
@param position
		Offset in the assembler source/AST.

@return Resolved content at the given position.
recaf-ui/src/main/java/software/coley/recaf/ui/pane/editing/assembler/resolve/AssemblyResolver.java