-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add containerName to CallHierarchyItem (#38997)
* Add containerName to CallHierarchyItem * Update public APIs * Update test to demonstrate nested namespace working
- Loading branch information
1 parent
0d6ae00
commit 852e7a0
Showing
10 changed files
with
244 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/baselines/reference/callHierarchyAccessor.callHierarchy.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165 changes: 165 additions & 0 deletions
165
tests/baselines/reference/callHierarchyContainerName.callHierarchy.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
╭ name: f | ||
├ kind: function | ||
├ file: /tests/cases/fourslash/callHierarchyContainerName.ts | ||
├ span: | ||
│ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:1:1-1:16 | ||
│ │ 1: function f() {} | ||
│ │ ^^^^^^^^^^^^^^^ | ||
│ ╰ | ||
├ selectionSpan: | ||
│ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:1:10-1:11 | ||
│ │ 1: function f() {} | ||
│ │ ^ | ||
│ ╰ | ||
├ incoming: | ||
│ ╭ from: | ||
│ │ ╭ name: sameName | ||
│ │ ├ kind: method | ||
│ │ ├ containerName: A | ||
│ │ ├ file: /tests/cases/fourslash/callHierarchyContainerName.ts | ||
│ │ ├ span: | ||
│ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:4:3-6:4 | ||
│ │ │ │ 4: static sameName() { | ||
│ │ │ │ ^^^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ 5: f(); | ||
│ │ │ │ ^^^^^^^^ | ||
│ │ │ │ 6: } | ||
│ │ │ │ ^^^ | ||
│ │ │ ╰ | ||
│ │ ├ selectionSpan: | ||
│ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:4:10-4:18 | ||
│ │ │ │ 4: static sameName() { | ||
│ │ │ │ ^^^^^^^^ | ||
│ │ │ ╰ | ||
│ │ ├ incoming: | ||
│ │ │ ╭ from: | ||
│ │ │ │ ╭ name: sameName | ||
│ │ │ │ ├ kind: method | ||
│ │ │ │ ├ containerName: B | ||
│ │ │ │ ├ file: /tests/cases/fourslash/callHierarchyContainerName.ts | ||
│ │ │ │ ├ span: | ||
│ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:10:3-12:4 | ||
│ │ │ │ │ │ 10: sameName() { | ||
│ │ │ │ │ │ ^^^^^^^^^^^^ | ||
│ │ │ │ │ │ 11: A.sameName(); | ||
│ │ │ │ │ │ ^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ 12: } | ||
│ │ │ │ │ │ ^^^ | ||
│ │ │ │ │ ╰ | ||
│ │ │ │ ├ selectionSpan: | ||
│ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:10:3-10:11 | ||
│ │ │ │ │ │ 10: sameName() { | ||
│ │ │ │ │ │ ^^^^^^^^ | ||
│ │ │ │ │ ╰ | ||
│ │ │ │ ├ incoming: | ||
│ │ │ │ │ ╭ from: | ||
│ │ │ │ │ │ ╭ name: sameName | ||
│ │ │ │ │ │ ├ kind: getter | ||
│ │ │ │ │ │ ├ containerName: Obj | ||
│ │ │ │ │ │ ├ file: /tests/cases/fourslash/callHierarchyContainerName.ts | ||
│ │ │ │ │ │ ├ span: | ||
│ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:16:3-18:4 | ||
│ │ │ │ │ │ │ │ 16: get sameName() { | ||
│ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ 17: return new B().sameName; | ||
│ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ 18: } | ||
│ │ │ │ │ │ │ │ ^^^ | ||
│ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ ├ selectionSpan: | ||
│ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:16:7-16:15 | ||
│ │ │ │ │ │ │ │ 16: get sameName() { | ||
│ │ │ │ │ │ │ │ ^^^^^^^^ | ||
│ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ ├ incoming: | ||
│ │ │ │ │ │ │ ╭ from: | ||
│ │ │ │ │ │ │ │ ╭ name: sameName | ||
│ │ │ │ │ │ │ │ ├ kind: function | ||
│ │ │ │ │ │ │ │ ├ containerName: Foo | ||
│ │ │ │ │ │ │ │ ├ file: /tests/cases/fourslash/callHierarchyContainerName.ts | ||
│ │ │ │ │ │ │ │ ├ span: | ||
│ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:22:3-24:4 | ||
│ │ │ │ │ │ │ │ │ │ 22: function sameName() { | ||
│ │ │ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ 23: return Obj.sameName; | ||
│ │ │ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ 24: } | ||
│ │ │ │ │ │ │ │ │ │ ^^^ | ||
│ │ │ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ │ │ ├ selectionSpan: | ||
│ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:22:12-22:20 | ||
│ │ │ │ │ │ │ │ │ │ 22: function sameName() { | ||
│ │ │ │ │ │ │ │ │ │ ^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ │ │ ├ incoming: | ||
│ │ │ │ │ │ │ │ │ ╭ from: | ||
│ │ │ │ │ │ │ │ │ │ ╭ name: C | ||
│ │ │ │ │ │ │ │ │ │ ├ kind: class | ||
│ │ │ │ │ │ │ │ │ │ ├ containerName: Foo | ||
│ │ │ │ │ │ │ │ │ │ ├ file: /tests/cases/fourslash/callHierarchyContainerName.ts | ||
│ │ │ │ │ │ │ │ │ │ ├ span: | ||
│ │ │ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:26:3-30:4 | ||
│ │ │ │ │ │ │ │ │ │ │ │ 26: export class C { | ||
│ │ │ │ │ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ │ │ 27: constructor() { | ||
│ │ │ │ │ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ │ │ 28: sameName(); | ||
│ │ │ │ │ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ │ │ 29: } | ||
│ │ │ │ │ │ │ │ │ │ │ │ ^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ │ │ 30: } | ||
│ │ │ │ │ │ │ │ │ │ │ │ ^^^ | ||
│ │ │ │ │ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ │ │ │ │ ├ selectionSpan: | ||
│ │ │ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:26:16-26:17 | ||
│ │ │ │ │ │ │ │ │ │ │ │ 26: export class C { | ||
│ │ │ │ │ │ │ │ │ │ │ │ ^ | ||
│ │ │ │ │ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ │ │ │ │ ├ incoming: | ||
│ │ │ │ │ │ │ │ │ │ │ ╭ from: | ||
│ │ │ │ │ │ │ │ │ │ │ │ ╭ name: sameName | ||
│ │ │ │ │ │ │ │ │ │ │ │ ├ kind: function | ||
│ │ │ │ │ │ │ │ │ │ │ │ ├ containerName: Bar | ||
│ │ │ │ │ │ │ │ │ │ │ │ ├ file: /tests/cases/fourslash/callHierarchyContainerName.ts | ||
│ │ │ │ │ │ │ │ │ │ │ │ ├ span: | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:34:20-34:37 | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ │ 34: const sameName = () => new Foo.C(); | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ │ ^^^^^^^^^^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ │ │ │ │ │ │ ├ selectionSpan: | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:34:9-34:17 | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ │ 34: const sameName = () => new Foo.C(); | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ │ ^^^^^^^^ | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ ╰ | ||
│ │ │ │ │ │ │ │ │ │ │ │ ╰ incoming: none | ||
│ │ │ │ │ │ │ │ │ │ │ ├ fromSpans: | ||
│ │ │ │ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:34:34-34:35 | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ 34: const sameName = () => new Foo.C(); | ||
│ │ │ │ │ │ │ │ │ │ │ │ │ ^ | ||
│ │ │ │ │ │ │ │ │ │ ╰ ╰ ╰ | ||
│ │ │ │ │ │ │ │ │ ├ fromSpans: | ||
│ │ │ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:28:7-28:15 | ||
│ │ │ │ │ │ │ │ │ │ │ 28: sameName(); | ||
│ │ │ │ │ │ │ │ │ │ │ ^^^^^^^^ | ||
│ │ │ │ │ │ │ │ ╰ ╰ ╰ | ||
│ │ │ │ │ │ │ ├ fromSpans: | ||
│ │ │ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:23:16-23:24 | ||
│ │ │ │ │ │ │ │ │ 23: return Obj.sameName; | ||
│ │ │ │ │ │ │ │ │ ^^^^^^^^ | ||
│ │ │ │ │ │ ╰ ╰ ╰ | ||
│ │ │ │ │ ├ fromSpans: | ||
│ │ │ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:17:20-17:28 | ||
│ │ │ │ │ │ │ 17: return new B().sameName; | ||
│ │ │ │ │ │ │ ^^^^^^^^ | ||
│ │ │ │ ╰ ╰ ╰ | ||
│ │ │ ├ fromSpans: | ||
│ │ │ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:11:7-11:15 | ||
│ │ │ │ │ 11: A.sameName(); | ||
│ │ │ │ │ ^^^^^^^^ | ||
│ │ ╰ ╰ ╰ | ||
│ ├ fromSpans: | ||
│ │ ╭ /tests/cases/fourslash/callHierarchyContainerName.ts:5:5-5:6 | ||
│ │ │ 5: f(); | ||
│ │ │ ^ | ||
│ ╰ ╰ | ||
╰ outgoing: none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
////function /**/f() {} | ||
//// | ||
////class A { | ||
//// static sameName() { | ||
//// f(); | ||
//// } | ||
////} | ||
//// | ||
////class B { | ||
//// sameName() { | ||
//// A.sameName(); | ||
//// } | ||
////} | ||
//// | ||
////const Obj = { | ||
//// get sameName() { | ||
//// return new B().sameName; | ||
//// } | ||
////}; | ||
//// | ||
////namespace Foo { | ||
//// function sameName() { | ||
//// return Obj.sameName; | ||
//// } | ||
//// | ||
//// export class C { | ||
//// constructor() { | ||
//// sameName(); | ||
//// } | ||
//// } | ||
////} | ||
//// | ||
////module Foo.Bar { | ||
//// const sameName = () => new Foo.C(); | ||
////} | ||
|
||
goTo.marker(); | ||
verify.baselineCallHierarchy(); |