Java Code Examples for org.eclipse.lsp4j.CompletionList#getItems()

The following examples show how to use org.eclipse.lsp4j.CompletionList#getItems() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_inner_class() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "package org.sample;\npublic class Test {}\n");
	int[] loc = findCompletionLocation(unit, "");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(5);
	assertEquals("class", item.getLabel());
	String te = item.getInsertText();
	assertEquals("/**\n * ${1:InnerTest}\n */\npublic class ${1:InnerTest} {\n\n\t${0}\n}", te);
}
 
Example 2
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_sibling_inner_interface() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "package org.sample;\npublic interface Test {}\npublic interface InnerTest{}\n");
	int[] loc = findCompletionLocation(unit, "package org.sample;\npublic interface Test {}\npublic interface InnerTest{}\n");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(6);
	assertEquals("interface", item.getLabel());
	String te = item.getInsertText();
	assertEquals("/**\n * ${1:InnerTest_1}\n */\npublic interface ${1:InnerTest_1} {\n\n\t${0}\n}", te);
}
 
Example 3
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Ignore(value = "When running tests, in SnippetCompletionProposal.getSnippetContent(), cu.getAllTypes() returns en empty array, so inner record name is not computed")
@Test
public void testSnippet_inner_record() throws Exception {
	importProjects("eclipse/records");
	project = WorkspaceHelper.getProject("records");
	ICompilationUnit unit = getWorkingCopy("src/main/java/org/sample/Test.java", "package org.sample;\npublic record Test() {}\n");
	int[] loc = findCompletionLocation(unit, "package org.sample;\npublic record Test() {");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(7);
	assertEquals("record", item.getLabel());
	String te = item.getInsertText();
	assertEquals("/**\n * ${1:InnerTest}\n */\npublic record ${1:InnerTest}(${0}) {\n}", te);
}
 
Example 4
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_class() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "");
	int[] loc = findCompletionLocation(unit, "");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(8);
	assertEquals("class", item.getLabel());
	String te = item.getInsertText();
	assertEquals("package org.sample;\n\n/**\n * Test\n */\npublic class Test {\n\n\t${0}\n}", te);
}
 
Example 5
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_ifnull() throws JavaModelException {
	//@formatter:off
	ICompilationUnit unit = getWorkingCopy(
		"src/org/sample/Test.java",
		"package org.sample;\n" +
		"public class Test {\n" +
		"	public void testMethod(Object obj) {\n" +
		"		ifnull" +
		"	}\n" +
		"}"
	);
	//@formatter:on
	int[] loc = findCompletionLocation(unit, "ifnull");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);

	List<CompletionItem> items = new ArrayList<>(list.getItems());
	CompletionItem item = items.get(0);
	assertEquals("ifnull", item.getLabel());
	String insertText = item.getInsertText();
	assertEquals("if (${1:obj} == null) {\n\t$TM_SELECTED_TEXT${0}\n}", insertText);
}
 
Example 6
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_ifelse() throws JavaModelException {
	//@formatter:off
	ICompilationUnit unit = getWorkingCopy(
		"src/org/sample/Test.java",
		"package org.sample;\n" +
		"public class Test {\n" +
		"	public void testMethod(boolean con) {\n" +
		"		ifelse" +
		"	}\n" +
		"}"
	);
	//@formatter:on
	int[] loc = findCompletionLocation(unit, "ifelse");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);

	List<CompletionItem> items = new ArrayList<>(list.getItems());
	CompletionItem item = items.get(0);
	assertEquals("ifelse", item.getLabel());
	String insertText = item.getInsertText();
	assertEquals("if (${1:con}) {\n\t${2}\n} else {\n\t${0}\n}", insertText);
}
 
Example 7
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_if() throws JavaModelException {
	//@formatter:off
	ICompilationUnit unit = getWorkingCopy(
		"src/org/sample/Test.java",
		"package org.sample;\n" +
		"public class Test {\n" +
		"	public void testMethod(boolean con) {\n" +
		"		if" +
		"	}\n" +
		"}"
	);
	//@formatter:on
	int[] loc = findCompletionLocation(unit, "if");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);

	List<CompletionItem> items = new ArrayList<>(list.getItems());
	CompletionItem item = items.get(5);
	assertEquals("if", item.getLabel());
	String insertText = item.getInsertText();
	assertEquals("if (${1:con}) {\n\t$TM_SELECTED_TEXT${0}\n}", insertText);
}
 
Example 8
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Ignore(value = "When running tests, in SnippetCompletionProposal.getSnippetContent(), cu.getAllTypes() returns en empty array, so inner record name is not computed")
@Test
public void testSnippet_sibling_inner_record() throws Exception {
	importProjects("eclipse/records");
	project = WorkspaceHelper.getProject("records");
	ICompilationUnit unit = getWorkingCopy("src/main/java/org/sample/Test.java", "package org.sample;\npublic record Test() {}\npublic record InnerTest(){}\n");
	int[] loc = findCompletionLocation(unit, "package org.sample;\npublic record Test {}\npublic record InnerTest(){}\n");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(7);
	assertEquals("record", item.getLabel());
	String te = item.getInsertText();
	assertEquals("/**\n * ${1:InnerTest_1}\n */\npublic record ${1:InnerTest_1}(${0) {\n}", te);
}
 
Example 9
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_array_fori() throws JavaModelException {
	//@formatter:off
	ICompilationUnit unit = getWorkingCopy(
		"src/org/sample/Test.java",
		"package org.sample;\n" +
		"public class Test {\n" +
		"	public void testMethod(String[] args) {\n" +
		"		fori" +
		"	}\n" +
		"}"
	);
	//@formatter:on
	int[] loc = findCompletionLocation(unit, "fori");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);

	List<CompletionItem> items = new ArrayList<>(list.getItems());
	CompletionItem item = items.get(0);
	assertEquals("fori", item.getLabel());
	String insertText = item.getInsertText();
	assertEquals("for (${1:int} ${2:i} = ${3:0}; ${2:i} < ${4:args.length}; ${2:i}++) {\n\t$TM_SELECTED_TEXT${0}\n}", insertText);
}
 
Example 10
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_array_foreach() throws JavaModelException {
	//@formatter:off
	ICompilationUnit unit = getWorkingCopy(
		"src/org/sample/Test.java",
		"package org.sample;\n" +
		"public class Test {\n" +
		"	public void testMethod(String[] args) {\n" +
		"		foreach" +
		"	}\n" +
		"}"
	);
	//@formatter:on
	int[] loc = findCompletionLocation(unit, "foreach");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);

	List<CompletionItem> items = new ArrayList<>(list.getItems());
	CompletionItem item = items.get(0);
	assertEquals("foreach", item.getLabel());
	String insertText = item.getInsertText();
	assertEquals("for (${1:String} ${2:string} : ${3:args}) {\n\t$TM_SELECTED_TEXT${0}\n}", insertText);
}
 
Example 11
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_systrace() throws JavaModelException {
	//@formatter:off
	ICompilationUnit unit = getWorkingCopy(
		"src/org/sample/Test.java",
		"package org.sample;\n" +
		"public class Test {\n" +
		"	public void testMethod() {\n" +
		"		systrace" +
		"	}\n" +
		"}"
	);
	//@formatter:on
	int[] loc = findCompletionLocation(unit, "systrace");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);

	List<CompletionItem> items = new ArrayList<>(list.getItems());
	CompletionItem item = items.get(0);
	assertEquals("systrace", item.getLabel());
	String insertText = item.getInsertText();
	assertEquals("System.out.println(\"Test.testMethod()\");", insertText);
}
 
Example 12
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_nested_inner_class() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "package org.sample;\npublic class Test {}\npublic class InnerTest{\n");
	int[] loc = findCompletionLocation(unit, "package org.sample;\npublic class Test {}\npublic class InnerTest{\n");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(21);
	assertEquals("class", item.getLabel());
	String te = item.getInsertText();
	assertNotNull(te);
	assertEquals("/**\n * ${1:InnerTest_1}\n */\npublic class ${1:InnerTest_1} {\n\n\t${0}\n}", te);
}
 
Example 13
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_nested_inner_interface() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "package org.sample;\npublic interface Test {}\npublic interface InnerTest{\n");
	int[] loc = findCompletionLocation(unit, "package org.sample;\npublic interface Test {}\npublic interface InnerTest{\n");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(23);
	assertEquals("interface", item.getLabel());
	String te = item.getInsertText();
	assertEquals("/**\n * ${1:InnerTest_1}\n */\npublic interface ${1:InnerTest_1} {\n\n\t${0}\n}", te);
}
 
Example 14
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_inner_interface() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "package org.sample;\npublic interface Test {}\n");
	int[] loc = findCompletionLocation(unit, "package org.sample;\npublic interface Test {}\n");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(6);
	assertEquals("interface", item.getLabel());
	String te = item.getInsertText();
	assertEquals("/**\n * ${1:InnerTest}\n */\npublic interface ${1:InnerTest} {\n\n\t${0}\n}", te);
}
 
Example 15
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testSnippet_sibling_inner_class() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "package org.sample;\npublic class Test {}\npublic class InnerTest{}\n");
	int[] loc = findCompletionLocation(unit, "package org.sample;\npublic class Test {}\npublic class InnerTest{}\n");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	assertFalse(items.isEmpty());
	items.sort((i1, i2) -> (i1.getSortText().compareTo(i2.getSortText())));

	CompletionItem item = items.get(5);
	assertEquals("class", item.getLabel());
	String te = item.getInsertText();
	assertEquals("/**\n * ${1:InnerTest_1}\n */\npublic class ${1:InnerTest_1} {\n\n\t${0}\n}", te);
}
 
Example 16
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testSnippet_no_record() throws JavaModelException {
	ICompilationUnit unit = getWorkingCopy("src/org/sample/Test.java", "");
	int[] loc = findCompletionLocation(unit, "");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();

	assertNotNull(list);
	List<CompletionItem> items = new ArrayList<>(list.getItems());
	//Not a Java 14 project => no snippet
	assertFalse("No record snippet should be available", items.stream().anyMatch(i -> "record".equals(i.getLabel())));
}
 
Example 17
Source File: CompletionHandlerTest.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testCompletion_object() throws Exception{
	ICompilationUnit unit = getWorkingCopy(
			"src/java/Foo.java",
			"public class Foo {\n"+
					"	void foo() {\n"+
					"		Objec\n"+
					"	}\n"+
			"}\n");
	int[] loc = findCompletionLocation(unit, "Objec");
	CompletionList list = server.completion(JsonMessageHelper.getParams(createCompletionRequest(unit, loc[0], loc[1]))).join().getRight();
	assertNotNull(list);
	assertFalse("No proposals were found",list.getItems().isEmpty());

	List<CompletionItem> items = list.getItems();
	for ( CompletionItem item : items) {
		assertTrue(isNotBlank(item.getLabel()));
		assertNotNull(item.getKind() );
		assertTrue(isNotBlank(item.getSortText()));
		//text edits are set during calls to "completion"
		assertNotNull(item.getTextEdit());
		assertTrue(isNotBlank(item.getInsertText()));
		assertNotNull(item.getFilterText());
		assertFalse(item.getFilterText().contains(" "));
		assertTrue(item.getLabel().startsWith(item.getInsertText()));
		assertTrue(item.getFilterText().startsWith("Objec"));
		//Check contains data used for completionItem resolution
		@SuppressWarnings("unchecked")
		Map<String,String> data = (Map<String, String>) item.getData();
		assertNotNull(data);
		assertTrue(isNotBlank(data.get(CompletionResolveHandler.DATA_FIELD_URI)));
		assertTrue(isNotBlank(data.get(CompletionResolveHandler.DATA_FIELD_PROPOSAL_ID)));
		assertTrue(isNotBlank(data.get(CompletionResolveHandler.DATA_FIELD_REQUEST_ID)));
	}
}
 
Example 18
Source File: CompletionProvider.java    From vscode-as3mxml with Apache License 2.0 5 votes vote down vote up
private void addMXMLLanguageTagToAutoComplete(String tagName, String prefix, boolean includeOpenTagBracket, boolean includeOpenTagPrefix, CompletionList result)
{
    List<CompletionItem> items = result.getItems();
    CompletionItem item = new CompletionItem();
    item.setKind(CompletionItemKind.Keyword);
    item.setLabel("fx:" + tagName);
    if (completionSupportsSnippets)
    {
        item.setInsertTextFormat(InsertTextFormat.Snippet);
    }
    item.setFilterText(tagName);
    item.setSortText(tagName);
    StringBuilder builder = new StringBuilder();
    if (includeOpenTagBracket)
    {
        builder.append("<");
    }
    if (includeOpenTagPrefix)
    {
        builder.append(prefix);
        builder.append(IMXMLCoreConstants.colon);
    }
    builder.append(tagName);
    builder.append(">");
    builder.append("\n");
    builder.append("\t");
    if (completionSupportsSnippets)
    {
        builder.append("$0");
    }
    builder.append("\n");
    builder.append("<");
    builder.append(IMXMLCoreConstants.slash);
    builder.append(prefix);
    builder.append(IMXMLCoreConstants.colon);
    builder.append(tagName);
    builder.append(">");
    item.setInsertText(builder.toString());
    items.add(item);
}
 
Example 19
Source File: CompletionProvider.java    From vscode-as3mxml with Apache License 2.0 4 votes vote down vote up
private void addLanguageAttributesToAutoCompleteMXML(TypeScope typeScope, ASScope otherScope, char nextChar, ILspProject project, CompletionList result)
{
    List<CompletionItem> items = result.getItems();

    CompletionItem includeInItem = new CompletionItem();
    includeInItem.setKind(CompletionItemKind.Keyword);
    includeInItem.setLabel(IMXMLLanguageConstants.ATTRIBUTE_INCLUDE_IN);
    if (completionSupportsSnippets
            && nextChar != '=')
    {
        includeInItem.setInsertTextFormat(InsertTextFormat.Snippet);
        includeInItem.setInsertText(IMXMLLanguageConstants.ATTRIBUTE_INCLUDE_IN + "=\"$0\"");
    }
    items.add(includeInItem);

    CompletionItem excludeFromItem = new CompletionItem();
    excludeFromItem.setKind(CompletionItemKind.Keyword);
    excludeFromItem.setLabel(IMXMLLanguageConstants.ATTRIBUTE_EXCLUDE_FROM);
    if (completionSupportsSnippets
            && nextChar != '=')
    {
        excludeFromItem.setInsertTextFormat(InsertTextFormat.Snippet);
        excludeFromItem.setInsertText(IMXMLLanguageConstants.ATTRIBUTE_EXCLUDE_FROM + "=\"$0\"");
    }
    items.add(excludeFromItem);

    Set<INamespaceDefinition> namespaceSet = ScopeUtils.getNamespaceSetForScopes(typeScope, otherScope, project);

    IDefinition idPropertyDefinition = typeScope.getPropertyByNameForMemberAccess((CompilerProject) project, IMXMLLanguageConstants.ATTRIBUTE_ID, namespaceSet);
    if (idPropertyDefinition == null)
    {
        CompletionItem idItem = new CompletionItem();
        idItem.setKind(CompletionItemKind.Keyword);
        idItem.setLabel(IMXMLLanguageConstants.ATTRIBUTE_ID);
        if (completionSupportsSnippets
                && nextChar != '=')
        {
            idItem.setInsertTextFormat(InsertTextFormat.Snippet);
            idItem.setInsertText(IMXMLLanguageConstants.ATTRIBUTE_ID + "=\"$0\"");
        }
        items.add(idItem);
    }

    if (frameworkSDKIsRoyale)
    {
        IDefinition localIdPropertyDefinition = typeScope.getPropertyByNameForMemberAccess((CompilerProject) project, IMXMLLanguageConstants.ATTRIBUTE_LOCAL_ID, namespaceSet);
        if (localIdPropertyDefinition == null)
        {
            CompletionItem localIdItem = new CompletionItem();
            localIdItem.setKind(CompletionItemKind.Keyword);
            localIdItem.setLabel(IMXMLLanguageConstants.ATTRIBUTE_LOCAL_ID);
            if (completionSupportsSnippets
                    && nextChar != '=')
            {
                localIdItem.setInsertTextFormat(InsertTextFormat.Snippet);
                localIdItem.setInsertText(IMXMLLanguageConstants.ATTRIBUTE_LOCAL_ID + "=\"$0\"");
            }
            items.add(localIdItem);
        }
    }
}
 
Example 20
Source File: CompletionProvider.java    From vscode-as3mxml with Apache License 2.0 4 votes vote down vote up
private CompletionList mxmlAttributeCompletion(IMXMLTagData offsetTag, int currentOffset, ILspProject project, CompletionList result)
{
    List<CompletionItem> items = result.getItems();
    IDefinition attributeDefinition = MXMLDataUtils.getDefinitionForMXMLTagAttribute(offsetTag, currentOffset, true, project);
    if (attributeDefinition instanceof IVariableDefinition)
    {
        IVariableDefinition variableDefinition = (IVariableDefinition) attributeDefinition;
        if (variableDefinition.getTypeAsDisplayString().equals(IASLanguageConstants.Boolean))
        {
            CompletionItem falseItem = new CompletionItem();
            falseItem.setKind(CompletionItemKind.Value);
            falseItem.setLabel(IASLanguageConstants.FALSE);
            items.add(falseItem);
            CompletionItem trueItem = new CompletionItem();
            trueItem.setKind(CompletionItemKind.Value);
            trueItem.setLabel(IASLanguageConstants.TRUE);
            items.add(trueItem);
            return result;
        }
        IMetaTag inspectableTag = variableDefinition.getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_INSPECTABLE);
        if (inspectableTag == null)
        {
            if (variableDefinition instanceof IAccessorDefinition)
            {
                IAccessorDefinition accessorDefinition = (IAccessorDefinition) variableDefinition;
                IAccessorDefinition otherAccessorDefinition = accessorDefinition.resolveCorrespondingAccessor(project);
                if (otherAccessorDefinition != null)
                {
                    inspectableTag = otherAccessorDefinition.getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_INSPECTABLE);
                }
            }
        }
        if (inspectableTag != null)
        {
            IMetaTagAttribute enumAttribute = inspectableTag.getAttribute(IMetaAttributeConstants.NAME_INSPECTABLE_ENUMERATION);
            if (enumAttribute != null)
            {
                String joinedValue = enumAttribute.getValue();
                String[] values = joinedValue.split(",");
                for (String value : values)
                {
                    value = value.trim();
                    if (value.length() == 0)
                    {
                        //skip empty values
                        continue;
                    }
                    CompletionItem enumItem = new CompletionItem();
                    enumItem.setKind(CompletionItemKind.Value);
                    enumItem.setLabel(value);
                    items.add(enumItem);
                }
            }
        }
    }
    if (attributeDefinition instanceof IStyleDefinition)
    {
        IStyleDefinition styleDefinition = (IStyleDefinition) attributeDefinition;
        for (String enumValue : styleDefinition.getEnumeration())
        {
            CompletionItem styleItem = new CompletionItem();
            styleItem.setKind(CompletionItemKind.Value);
            styleItem.setLabel(enumValue);
            items.add(styleItem);
        }
    }
    return result;
}