<commit_before>/*
 * generated by Xtext
 */
package de.cooperateproject.modeling.textual.cls.ui.contentassist

/**
 * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#content-assist
 * on how to customize the content assistant.
 */
class ClsProposalProvider extends AbstractClsProposalProvider {
	
//	override completeClass_ReferencedElement(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
//		
//	}
	
}
<commit_msg>Added simple proposal provider which allows to import classes from uml<commit_after>/*
 * generated by Xtext
 */
package de.cooperateproject.modeling.textual.cls.ui.contentassist

import org.eclipse.emf.ecore.EObject
import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor
import org.eclipse.xtext.RuleCall
import com.google.inject.Inject
import org.eclipse.xtext.scoping.IScopeProvider
import de.cooperateproject.modeling.textual.cls.cls.ClsPackage
import org.eclipse.uml2.uml.Class

class ClsProposalProvider extends AbstractClsProposalProvider {
	@Inject IScopeProvider scope

	override complete_Class(EObject model, RuleCall ruleCall, ContentAssistContext context,
		ICompletionProposalAcceptor acceptor) {
		
		var scope = scope.getScope(model, ClsPackage.Literals.UML_REFERENCING_ELEMENT__REFERENCED_ELEMENT);
		
		var elements = scope.allElements
		var classes = elements.map[x|x.EObjectOrProxy].filter(Class)
		for (class : classes) {
			acceptor.accept(createCompletionProposal(getClassProposal(class), class.name, null, context))
		}
	}
	
	private def getClassProposal(Class c) {
		'''
		class c.name {
		}
		'''.toString()
	}
}

{'fraction_non_alphanumeric': 0.0893760539629005, 'fraction_numerical': 0.0022484541877459247, 'mean_word_length': 4.615141955835962, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1123034', 'n_tokens_mistral': 591, 'n_tokens_neox': 555, 'n_words': 100}