TypeScript/tests/cases/fourslash/completionsThisProperties_globalType.ts
Andrew Branch 23b500cadf
Don’t offer this. completions on self, window, global, globalThis. Disambiguate this. completions from others in details requests. (#37652)
* Special-case window, self, global, globalThis methods

* Disambiguate global and this property completions in details requests

* Hide the Map<boolean> implementation

* Update old tests

* Replace SymbolOriginKind stringification with dedicated enum
2020-03-31 12:40:57 -07:00

33 lines
697 B
TypeScript

/// <reference path="fourslash.ts" />
// #37091
// @lib: dom
// @allowJs: true
// @Filename: globals.d.ts
//// declare var global: { console: Console };
// @Filename: index.js
//// window.f = function() { console/*1*/ }
//// self.g = function() { console/*2*/ }
//// global.h = function() { console/*3*/ }
//// globalThis.i = function() { console/*4*/ }
test.markerNames().forEach(marker => {
verify.completions({
marker,
includes: [{
name: "console",
insertText: undefined,
kind: "var",
kindModifiers: "declare",
sortText: completion.SortText.GlobalsOrKeywords
}]
}, {
preferences: {
includeInsertTextCompletions: true
}
});
});