33namespace Complete \Completer ;
44
55use Entity \Project ;
6+ use Entity \Node \MethodData ;
67use Entity \Completion \Context ;
78use Entity \Completion \Entry ;
89use Entity \Completion \Scope ;
@@ -41,7 +42,7 @@ protected function getEntriesForVar(
4142 $ class = $ index ->findClassByFQCN ($ fqcn );
4243 $ entries = [];
4344 foreach ($ class ->methods ->all () AS $ method ){
44- $ entry = new Entry ( $ method -> name , $ method-> getSignature () );
45+ $ entry = $ this -> createEntryForMethod ( $ method );
4546 $ entries [] = $ entry ;
4647 }
4748 foreach ($ class ->properties ->all () AS $ property ){
@@ -68,7 +69,7 @@ protected function getEntriesForThis(
6869 }
6970 $ entries = [];
7071 foreach ($ class ->methods ->all () AS $ method ){
71- $ entry = new Entry ( $ method -> name , $ method-> getSignature () );
72+ $ entry = $ this -> createEntryForMethod ( $ method );
7273 $ entries [] = $ entry ;
7374 }
7475 foreach ($ class ->properties ->all () AS $ property ){
@@ -77,6 +78,19 @@ protected function getEntriesForThis(
7778 }
7879 return $ entries ;
7980 }
81+ /**
82+ * Creates menu entry for MethodData
83+ *
84+ * @param MethodData $method a method
85+ * @return Entry
86+ */
87+ protected function createEntryForMethod (MethodData $ method ){
88+ return new Entry (
89+ $ method ->name ,
90+ $ method ->getSignature (),
91+ sprintf ("%s \n%s \n" , $ method ->getSignature (), $ method ->doc )
92+ );
93+ }
8094
8195 private $ logger ;
8296}
0 commit comments