mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
More test fixes
This commit is contained in:
parent
8948fe415f
commit
f37ae23f7e
@ -4,16 +4,20 @@
|
||||
//// declare module JSX {
|
||||
//// interface Element { }
|
||||
//// interface IntrinsicElements {
|
||||
//// [|{| "isWriteAccess": true, "isDefinition": true |}div|]: {
|
||||
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}div|]: {
|
||||
//// name?: string;
|
||||
//// isOpen?: boolean;
|
||||
//// };
|
||||
//// };|]
|
||||
//// span: { n: string; };
|
||||
//// }
|
||||
//// }
|
||||
//// var x = <[|div|] />;
|
||||
|
||||
verify.singleReferenceGroup(`(property) JSX.IntrinsicElements.div: {
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
`(property) JSX.IntrinsicElements.div: {
|
||||
name?: string;
|
||||
isOpen?: boolean;
|
||||
}`);
|
||||
}`,
|
||||
rangesByText.get("div")
|
||||
);
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
//// className?: string;
|
||||
//// }
|
||||
//// interface ButtonProps extends ClickableProps {
|
||||
//// [|{| "isDefinition": true |}onClick|](event?: React.MouseEvent<HTMLButtonElement>): void;
|
||||
//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}onClick|](event?: React.MouseEvent<HTMLButtonElement>): void;|]
|
||||
//// }
|
||||
//// interface LinkProps extends ClickableProps {
|
||||
//// goTo: string;
|
||||
@ -25,9 +25,13 @@
|
||||
//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
|
||||
//// let opt = <MainButton />;
|
||||
//// let opt = <MainButton children="chidlren" />;
|
||||
//// let opt = <MainButton [|{| "isWriteAccess": true, "isDefinition": true |}onClick|]={()=>{}} />;
|
||||
//// let opt = <MainButton [|{| "isWriteAccess": true, "isDefinition": true |}onClick|]={()=>{}} ignore-prop />;
|
||||
//// let opt = <MainButton [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}onClick|]={()=>{}}|] />;
|
||||
//// let opt = <MainButton [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}onClick|]={()=>{}}|] ignore-prop />;
|
||||
//// let opt = <MainButton goTo="goTo" />;
|
||||
//// let opt = <MainButton wrong />;
|
||||
|
||||
verify.singleReferenceGroup("(method) ButtonProps.onClick(event?: any): void");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
"(method) ButtonProps.onClick(event?: any): void",
|
||||
rangesByText.get("onClick")
|
||||
);
|
||||
|
||||
@ -5,12 +5,16 @@
|
||||
//// interface Element { }
|
||||
//// interface IntrinsicElements {
|
||||
//// div: {
|
||||
//// [|{| "isWriteAccess": true, "isDefinition": true |}name|]?: string;
|
||||
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}name|]?: string;|]
|
||||
//// isOpen?: boolean;
|
||||
//// };
|
||||
//// span: { n: string; };
|
||||
//// }
|
||||
//// }
|
||||
//// var x = <div [|{| "isWriteAccess": true, "isDefinition": true |}name|]="hello" />;
|
||||
//// var x = <div [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}name|]="hello"|] />;
|
||||
|
||||
verify.singleReferenceGroup("(property) name?: string");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
"(property) name ?: string",
|
||||
rangesByText.get("name")
|
||||
);
|
||||
|
||||
@ -9,11 +9,15 @@
|
||||
//// }
|
||||
//// class MyClass {
|
||||
//// props: {
|
||||
//// [|{| "isDefinition": true |}name|]?: string;
|
||||
//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}name|]?: string;|]
|
||||
//// size?: number;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// var x = <MyClass [|{| "isWriteAccess": true, "isDefinition": true |}name|]='hello'/>;
|
||||
//// var x = <MyClass [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}name|]='hello'|]/>;
|
||||
|
||||
verify.singleReferenceGroup("(property) name?: string");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
"(property) name?: string",
|
||||
rangesByText.get("name")
|
||||
);
|
||||
|
||||
@ -7,13 +7,17 @@
|
||||
//// }
|
||||
//// interface ElementAttributesProperty { props }
|
||||
//// }
|
||||
//// class [|{| "isWriteAccess": true, "isDefinition": true |}MyClass|] {
|
||||
//// [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}MyClass|] {
|
||||
//// props: {
|
||||
//// name?: string;
|
||||
//// size?: number;
|
||||
//// }
|
||||
//// }|]
|
||||
////
|
||||
////
|
||||
//// var x = <[|MyClass|] name='hello'></[|MyClass|]>;
|
||||
|
||||
verify.singleReferenceGroup("class MyClass");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
"class MyClass",
|
||||
rangesByText.get("MyClass")
|
||||
);
|
||||
|
||||
@ -15,11 +15,15 @@
|
||||
//// propString: string
|
||||
//// optional?: boolean
|
||||
//// }
|
||||
//// declare function [|{| "isWriteAccess": true, "isDefinition": true |}Opt|](attributes: OptionPropBag): JSX.Element;
|
||||
//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}Opt|](attributes: OptionPropBag): JSX.Element;|]
|
||||
//// let opt = <[|Opt|] />;
|
||||
//// let opt1 = <[|Opt|] propx={100} propString />;
|
||||
//// let opt2 = <[|Opt|] propx={100} optional/>;
|
||||
//// let opt3 = <[|Opt|] wrong />;
|
||||
//// let opt4 = <[|Opt|] propx={100} propString="hi" />;
|
||||
|
||||
verify.singleReferenceGroup("function Opt(attributes: OptionPropBag): JSX.Element");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
"function Opt(attributes: OptionPropBag): JSX.Element",
|
||||
rangesByText.get("Opt")
|
||||
);
|
||||
|
||||
@ -11,14 +11,18 @@
|
||||
//// interface ElementAttributesProperty { props; }
|
||||
//// }
|
||||
//// interface OptionPropBag {
|
||||
//// [|{| "isDefinition": true |}propx|]: number
|
||||
//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}propx|]: number|]
|
||||
//// propString: string
|
||||
//// optional?: boolean
|
||||
//// }
|
||||
//// declare function Opt(attributes: OptionPropBag): JSX.Element;
|
||||
//// let opt = <Opt />;
|
||||
//// let opt1 = <Opt [|{| "isWriteAccess": true, "isDefinition": true |}propx|]={100} propString />;
|
||||
//// let opt2 = <Opt [|{| "isWriteAccess": true, "isDefinition": true |}propx|]={100} optional/>;
|
||||
//// let opt1 = <Opt [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}propx|]={100}|] propString />;
|
||||
//// let opt2 = <Opt [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}propx|]={100}|] optional/>;
|
||||
//// let opt3 = <Opt wrong />;
|
||||
|
||||
verify.singleReferenceGroup("(property) OptionPropBag.propx: number");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
"(property) OptionPropBag.propx: number",
|
||||
rangesByText.get("propx")
|
||||
);
|
||||
|
||||
@ -20,9 +20,9 @@
|
||||
//// interface LinkProps extends ClickableProps {
|
||||
//// goTo: string;
|
||||
//// }
|
||||
//// declare function [|{| "isWriteAccess": true, "isDefinition": true |}MainButton|](buttonProps: ButtonProps): JSX.Element;
|
||||
//// declare function [|{| "isWriteAccess": true, "isDefinition": true |}MainButton|](linkProps: LinkProps): JSX.Element;
|
||||
//// declare function [|{| "isWriteAccess": true, "isDefinition": true |}MainButton|](props: ButtonProps | LinkProps): JSX.Element;
|
||||
//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}MainButton|](buttonProps: ButtonProps): JSX.Element;|]
|
||||
//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}MainButton|](linkProps: LinkProps): JSX.Element;|]
|
||||
//// [|declare function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}MainButton|](props: ButtonProps | LinkProps): JSX.Element;|]
|
||||
//// let opt = <[|MainButton|] />;
|
||||
//// let opt = <[|MainButton|] children="chidlren" />;
|
||||
//// let opt = <[|MainButton|] onClick={()=>{}} />;
|
||||
@ -30,4 +30,8 @@
|
||||
//// let opt = <[|MainButton|] goTo="goTo" />;
|
||||
//// let opt = <[|MainButton|] wrong />;
|
||||
|
||||
verify.singleReferenceGroup("function MainButton(buttonProps: ButtonProps): JSX.Element (+2 overloads)");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup(
|
||||
"function MainButton(buttonProps: ButtonProps): JSX.Element (+2 overloads)",
|
||||
rangesByText.get("MainButton")
|
||||
);
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
//// onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
|
||||
//// }
|
||||
//// interface LinkProps extends ClickableProps {
|
||||
//// [|{| "isDefinition": true |}goTo|]: string;
|
||||
//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}goTo|]: string;|]
|
||||
//// }
|
||||
//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
|
||||
//// declare function MainButton(linkProps: LinkProps): JSX.Element;
|
||||
@ -27,8 +27,9 @@
|
||||
//// let opt = <MainButton children="chidlren" />;
|
||||
//// let opt = <MainButton onClick={()=>{}} />;
|
||||
//// let opt = <MainButton onClick={()=>{}} ignore-prop />;
|
||||
//// let opt = <MainButton [|{| "isWriteAccess": true, "isDefinition": true |}goTo|]="goTo" />;
|
||||
//// let opt = <MainButton [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}goTo|]="goTo"|] />;
|
||||
//// let opt = <MainButton [|{| "isWriteAccess": true, "isDefinition": true |}goTo|] />;
|
||||
//// let opt = <MainButton wrong />;
|
||||
|
||||
verify.singleReferenceGroup("(property) LinkProps.goTo: string");
|
||||
const rangesByText = test.rangesByText();
|
||||
verify.singleReferenceGroup("(property) LinkProps.goTo: string", rangesByText.get("goTo"));
|
||||
|
||||
@ -18,11 +18,12 @@
|
||||
//// return <h1>World </h1>;
|
||||
//// }
|
||||
|
||||
//// var [|{| "isWriteAccess": true, "isDefinition": true |}SFCComp|] = SFC1 || SFC2;
|
||||
//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}SFCComp|] = SFC1 || SFC2;|]
|
||||
//// <[|SFCComp|] x={ "hi" } />
|
||||
|
||||
const [, r1, r2] = test.ranges();
|
||||
verify.singleReferenceGroup(`var SFCComp: ((prop: {
|
||||
x: number;
|
||||
}) => JSX.Element) | ((prop: {
|
||||
x: boolean;
|
||||
}) => JSX.Element)`);
|
||||
}) => JSX.Element)`, [r1, r2]);
|
||||
|
||||
@ -17,7 +17,8 @@
|
||||
//// private method() { }
|
||||
//// }
|
||||
|
||||
//// var [|{| "isWriteAccess": true, "isDefinition": true |}RCComp|] = RC1 || RC2;
|
||||
//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}RCComp|] = RC1 || RC2;|]
|
||||
//// <[|RCComp|] />
|
||||
|
||||
verify.singleReferenceGroup("var RCComp: typeof RC1");
|
||||
const [, r1, r2 ] = test.ranges();
|
||||
verify.singleReferenceGroup("var RCComp: typeof RC1", [r1, r2]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user