diff --git a/src/services/services.ts b/src/services/services.ts index ef26f930243..42f6160bd3e 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4663,15 +4663,19 @@ module ts { else if (flags & SymbolFlags.Enum) { return ClassificationTypeNames.enumName; } - else if (flags & SymbolFlags.Interface) { - return ClassificationTypeNames.interfaceName; - } - else if (flags & SymbolFlags.TypeParameter) { - return ClassificationTypeNames.typeParameterName; + else if (meaningAtPosition & SemanticMeaning.Type) { + if (flags & SymbolFlags.Interface) { + return ClassificationTypeNames.interfaceName; + } + else if (flags & SymbolFlags.TypeParameter) { + return ClassificationTypeNames.typeParameterName; + } } else if (flags & SymbolFlags.Module) { return ClassificationTypeNames.moduleName; } + + return undefined; } function processNode(node: Node) { diff --git a/tests/cases/fourslash/semanticClassification2.ts b/tests/cases/fourslash/semanticClassification2.ts index 8d393140154..810636dba3e 100644 --- a/tests/cases/fourslash/semanticClassification2.ts +++ b/tests/cases/fourslash/semanticClassification2.ts @@ -8,5 +8,4 @@ //// Thing.toExponential(); var c = classification; -// NOTE: this is *wrong*, but will be fixed shortly. -verify.semanticClassificationsAre(c.interfaceName("Thing"), c.interfaceName("Thing"), c.interfaceName("Thing")); \ No newline at end of file +verify.semanticClassificationsAre(c.interfaceName("Thing")); \ No newline at end of file diff --git a/tests/cases/fourslash/semanticClassification3.ts b/tests/cases/fourslash/semanticClassification3.ts new file mode 100644 index 00000000000..c1d8da243e7 --- /dev/null +++ b/tests/cases/fourslash/semanticClassification3.ts @@ -0,0 +1,12 @@ +/// + +////declare module M { +//// interface I { +//// +//// } +////} +//// +////var M = { I: 10 }; + +var c = classification; +verify.semanticClassificationsAre(c.moduleName("M"), c.interfaceName("I"), c.moduleName("M")); \ No newline at end of file