mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-27 11:18:42 +03:00
Made small improvement to completion provider.
This commit is contained in:
parent
ece3d08002
commit
abc7a6a433
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user