Made small improvement to completion provider.

This commit is contained in:
Eric Traut 2019-09-24 15:14:20 -07:00
parent ece3d08002
commit abc7a6a433

View File

@ -191,6 +191,8 @@ export class CompletionProvider {
// node. // node.
const initialNode = node; const initialNode = node;
const initialDepth = node ? ParseTreeUtils.getNodeDepth(node) : 0; const initialDepth = node ? ParseTreeUtils.getNodeDepth(node) : 0;
if (!initialNode || initialNode.nodeType !== ParseNodeType.Name) {
let curOffset = offset; let curOffset = offset;
while (curOffset >= 0) { while (curOffset >= 0) {
curOffset--; curOffset--;
@ -209,6 +211,7 @@ export class CompletionProvider {
break; break;
} }
} }
}
if (node === undefined) { if (node === undefined) {
return undefined; return undefined;