mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Add test for old completion bug from prop of constraint (#54959)
This commit is contained in:
parent
3b6e35c536
commit
c468960578
@ -0,0 +1,194 @@
|
||||
=== /tests/cases/fourslash/completionPropertyFromConstraint.ts ===
|
||||
// interface Styles {
|
||||
// alignContent: string | null;
|
||||
// alignItems: string | null;
|
||||
// alignmentBaseline: string | null;
|
||||
// // etc..
|
||||
// [key: string]: any
|
||||
// }
|
||||
//
|
||||
// interface StyleMap {
|
||||
// [name: string]: Partial<Styles>
|
||||
// }
|
||||
//
|
||||
// declare function createStyles<T extends StyleMap>(styles: T): T
|
||||
//
|
||||
// createStyles({
|
||||
// x: {
|
||||
// '': ''
|
||||
//
|
||||
// | ----------------------------------------------------------------------
|
||||
// | (property) alignContent?: string
|
||||
// | (property) alignItems?: string
|
||||
// | (property) alignmentBaseline?: string
|
||||
// | ----------------------------------------------------------------------
|
||||
// }
|
||||
// });
|
||||
|
||||
[
|
||||
{
|
||||
"marker": {
|
||||
"fileName": "/tests/cases/fourslash/completionPropertyFromConstraint.ts",
|
||||
"position": 300,
|
||||
"name": "1"
|
||||
},
|
||||
"item": {
|
||||
"isGlobalCompletion": false,
|
||||
"isMemberCompletion": true,
|
||||
"isNewIdentifierLocation": false,
|
||||
"optionalReplacementSpan": {
|
||||
"start": 300,
|
||||
"length": 0
|
||||
},
|
||||
"entries": [
|
||||
{
|
||||
"name": "alignContent",
|
||||
"kind": "property",
|
||||
"kindModifiers": "optional",
|
||||
"sortText": "11",
|
||||
"replacementSpan": {
|
||||
"start": 300,
|
||||
"length": 0
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "property",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "alignContent",
|
||||
"kind": "propertyName"
|
||||
},
|
||||
{
|
||||
"text": "?",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "string",
|
||||
"kind": "keyword"
|
||||
}
|
||||
],
|
||||
"documentation": []
|
||||
},
|
||||
{
|
||||
"name": "alignItems",
|
||||
"kind": "property",
|
||||
"kindModifiers": "optional",
|
||||
"sortText": "11",
|
||||
"replacementSpan": {
|
||||
"start": 300,
|
||||
"length": 0
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "property",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "alignItems",
|
||||
"kind": "propertyName"
|
||||
},
|
||||
{
|
||||
"text": "?",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "string",
|
||||
"kind": "keyword"
|
||||
}
|
||||
],
|
||||
"documentation": []
|
||||
},
|
||||
{
|
||||
"name": "alignmentBaseline",
|
||||
"kind": "property",
|
||||
"kindModifiers": "optional",
|
||||
"sortText": "11",
|
||||
"replacementSpan": {
|
||||
"start": 300,
|
||||
"length": 0
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "property",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "alignmentBaseline",
|
||||
"kind": "propertyName"
|
||||
},
|
||||
{
|
||||
"text": "?",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "string",
|
||||
"kind": "keyword"
|
||||
}
|
||||
],
|
||||
"documentation": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
23
tests/cases/fourslash/completionPropertyFromConstraint.ts
Normal file
23
tests/cases/fourslash/completionPropertyFromConstraint.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
//// interface Styles {
|
||||
//// alignContent: string | null;
|
||||
//// alignItems: string | null;
|
||||
//// alignmentBaseline: string | null;
|
||||
//// // etc..
|
||||
//// [key: string]: any
|
||||
//// }
|
||||
////
|
||||
//// interface StyleMap {
|
||||
//// [name: string]: Partial<Styles>
|
||||
//// }
|
||||
////
|
||||
//// declare function createStyles<T extends StyleMap>(styles: T): T
|
||||
////
|
||||
//// createStyles({
|
||||
//// x: {
|
||||
//// '/*1*/': ''
|
||||
//// }
|
||||
//// });
|
||||
|
||||
verify.baselineCompletions();
|
||||
Loading…
x
Reference in New Issue
Block a user