If we are comparing left hand side for is position of type node, it is false, because it is namespace position and not type position

Fixes #837
This commit is contained in:
Sheetal Nandi 2014-11-10 19:19:33 -08:00
parent 04e2169f03
commit 57af2623c6
8 changed files with 18 additions and 11 deletions

View File

@ -8467,7 +8467,7 @@ module ts {
// above them to find the lowest container
case SyntaxKind.Identifier:
// If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
if (node.parent.kind === SyntaxKind.QualifiedName) {
if (node.parent.kind === SyntaxKind.QualifiedName && (<QualifiedName>node.parent).right === node) {
node = node.parent;
}
// fall through

View File

@ -2,7 +2,7 @@
class Foo<T extends Foo.Bar> {
>Foo : Foo<T>
>T : T
>Foo : Foo<T>
>Foo : unknown
>Bar : Foo.Bar
constructor() {

View File

@ -5,7 +5,7 @@ import Foo = require('exportAssignClassAndModule_0');
var z: Foo.Bar;
>z : Foo.Bar
>Foo : Foo
>Foo : unknown
>Bar : Foo.Bar
var zz: Foo;
@ -23,7 +23,7 @@ class Foo {
x: Foo.Bar;
>x : Foo.Bar
>Foo : Foo
>Foo : unknown
>Bar : Foo.Bar
}
module Foo {

View File

@ -11,7 +11,7 @@ interface server {
>server : server
(): server.Server;
>server : server
>server : unknown
>Server : server.Server
startTime: Date;

View File

@ -61,12 +61,12 @@ import clolias = clodule;
var p: clolias.Point;
>p : alias.Point
>clolias : clodule
>clolias : unknown
>Point : clolias.Point
var p: clodule.Point;
>p : alias.Point
>clodule : clodule
>clodule : unknown
>Point : clolias.Point
var p: { x: number; y: number; };

View File

@ -13,7 +13,7 @@ interface Foo<T> {
}
var Foo: new () => Foo.A<Foo<string>>;
>Foo : new () => Foo.A<Foo<string>>
>Foo : Foo<T>
>Foo : unknown
>A : Foo.A<T>
>Foo : Foo<T>

View File

@ -10,9 +10,7 @@
goTo.marker('1');
verify.completionListContains('I');
// bug #837
verify.completionListContains('foo');
verify.not.completionListContains('foo');
edit.insert('I;');
goTo.marker('2');

View File

@ -0,0 +1,9 @@
/// <reference path='fourslash.ts'/>
////declare class m3f { foo(x: number): void }
////module m3f { export interface I { foo(): void } }
////var x: m3f./**/
goTo.marker();
debugger;
verify.not.completionListContains("foo");