MCPcopy
hub / github.com/dianping/cat / completeExpr

Function completeExpr

cat-home/src/main/webapp/assets/js/editor/worker-xquery.js:2752–2763  ·  view source on GitHub ↗
(line, pos, sctx)

Source from the content-addressed store, hash-verified

2750};
2751
2752var completeExpr = function(line, pos, sctx){
2753 var identifier = retrievePrecedingIdentifier(line, pos.col, nameCharRegExp);
2754 var before = line.substring(0, pos.col - (identifier.length === 0 ? 0 : identifier.length));
2755 var isVar = before[before.length - 1] === '$';
2756 if(isVar) {
2757 return completeVariable(identifier, pos, sctx);
2758 } else if(identifier !== '') {
2759 return completeFunction(identifier, pos, sctx).concat(completePrefix(identifier, pos, sctx));
2760 } else {
2761 return completeVariable(identifier, pos, sctx).concat(completeFunction(identifier, pos, sctx)).concat(completePrefix(identifier, pos, sctx));
2762 }
2763};
2764
2765var completeModuleUri = function(line, pos, sctx){
2766 var identifier = retrievePrecedingIdentifier(line, pos.col, uriRegex);

Callers 1

worker-xquery.jsFile · 0.85

Calls 4

completeVariableFunction · 0.85
completeFunctionFunction · 0.85
completePrefixFunction · 0.85

Tested by

no test coverage detected