mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Fix #8415: Add method declaration to contextually typed locations when searching for symbols
This commit is contained in:
43
tests/cases/fourslash/renameContextuallyTypedProperties.ts
Normal file
43
tests/cases/fourslash/renameContextuallyTypedProperties.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////interface I {
|
||||
//// [|prop1|]: () => void;
|
||||
//// prop2(): void;
|
||||
////}
|
||||
////
|
||||
////var o1: I = {
|
||||
//// [|prop1|]() { },
|
||||
//// prop2() { }
|
||||
////};
|
||||
////
|
||||
////var o2: I = {
|
||||
//// [|prop1|]: () => { },
|
||||
//// prop2: () => { }
|
||||
////};
|
||||
////
|
||||
////var o3: I = {
|
||||
//// get [|prop1|]() { return () => { }; },
|
||||
//// get prop2() { return () => { }; }
|
||||
////};
|
||||
////
|
||||
////var o4: I = {
|
||||
//// set [|prop1|](v) { },
|
||||
//// set prop2(v) { }
|
||||
////};
|
||||
////
|
||||
////var o5: I = {
|
||||
//// "[|prop1|]"() { },
|
||||
//// "prop2"() { }
|
||||
////};
|
||||
////
|
||||
////var o6: I = {
|
||||
//// "[|prop1|]": function () { },
|
||||
//// "prop2": function () { }
|
||||
////};
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.file(range.fileName);
|
||||
goTo.position(range.start);
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
||||
}
|
||||
43
tests/cases/fourslash/renameContextuallyTypedProperties2.ts
Normal file
43
tests/cases/fourslash/renameContextuallyTypedProperties2.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////interface I {
|
||||
//// prop1: () => void;
|
||||
//// [|prop2|](): void;
|
||||
////}
|
||||
////
|
||||
////var o1: I = {
|
||||
//// prop1() { },
|
||||
//// [|prop2|]() { }
|
||||
////};
|
||||
////
|
||||
////var o2: I = {
|
||||
//// prop1: () => { },
|
||||
//// [|prop2|]: () => { }
|
||||
////};
|
||||
////
|
||||
////var o3: I = {
|
||||
//// get prop1() { return () => { }; },
|
||||
//// get [|prop2|]() { return () => { }; }
|
||||
////};
|
||||
////
|
||||
////var o4: I = {
|
||||
//// set prop1(v) { },
|
||||
//// set [|prop2|](v) { }
|
||||
////};
|
||||
////
|
||||
////var o5: I = {
|
||||
//// "prop1"() { },
|
||||
//// "[|prop2|]"() { }
|
||||
////};
|
||||
////
|
||||
////var o6: I = {
|
||||
//// "prop1": function () { },
|
||||
//// "[|prop2|]": function () { }
|
||||
////};
|
||||
|
||||
let ranges = test.ranges()
|
||||
for (let range of ranges) {
|
||||
goTo.file(range.fileName);
|
||||
goTo.position(range.start);
|
||||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
|
||||
}
|
||||
Reference in New Issue
Block a user