use of org.wso2.ballerinalang.compiler.tree.types.BLangType in project ballerina by ballerina-lang.
the class BLangPackageBuilder method markTypeNodeAsGrouped.
public void markTypeNodeAsGrouped(Set<Whitespace> ws) {
BLangType typeNode = (BLangType) this.typeNodeStack.peek();
typeNode.addWS(ws);
typeNode.grouped = true;
}
use of org.wso2.ballerinalang.compiler.tree.types.BLangType in project ballerina by ballerina-lang.
the class ConnectorContextItemSorter method sortItems.
@Override
public void sortItems(TextDocumentServiceContext ctx, List<CompletionItem> completionItems) {
BLangNode previousNode = ctx.get(CompletionKeys.PREVIOUS_NODE_KEY);
/*
Remove the statement type completion type. When the going through the parser
rule contexts such as typeNameContext, we add the statements as well.
Sorters are responsible for to the next level of such filtering.
*/
this.removeCompletionsByType(new ArrayList<>(Collections.singletonList(ItemResolverConstants.STATEMENT_TYPE)), completionItems);
if (previousNode == null) {
this.populateWhenCursorBeforeOrAfterEp(completionItems);
} else if (previousNode instanceof BLangVariableDef) {
// BType bLangType = ((BLangVariableDef) previousNode).var.type;
// if (bLangType instanceof BEndpointType) {
// this.populateWhenCursorBeforeOrAfterEp(completionItems);
// } else {
this.setPriorities(completionItems);
CompletionItem resItem = this.getActionSnippet();
resItem.setSortText(Priority.PRIORITY160.toString());
completionItems.add(resItem);
// }
} else if (previousNode instanceof BLangAction) {
completionItems.clear();
completionItems.add(this.getActionSnippet());
}
}
Aggregations