@@ -112,6 +112,38 @@ describe("PluginRegistry", () => {
112112 expect ( result ) . toBeNull ( ) ;
113113 } ) ;
114114
115+ it ( "analyzeFileFull delegates when the plugin implements it" , ( ) => {
116+ const registry = new PluginRegistry ( ) ;
117+ const plugin = createMockPlugin ( "ts-plugin" , [ "typescript" ] ) ;
118+ plugin . analyzeFileFull = ( ) => ( {
119+ structure : {
120+ ...emptyAnalysis ,
121+ functions : [ { name : "hello" , lineRange : [ 1 , 5 ] , params : [ ] } ] ,
122+ } ,
123+ callGraph : [ { caller : "hello" , callee : "world" , lineNumber : 2 } ] ,
124+ } ) ;
125+ registry . register ( plugin ) ;
126+
127+ const result = registry . analyzeFileFull ( "src/test.ts" , "const x = 1;" ) ;
128+ expect ( result ) . not . toBeNull ( ) ;
129+ expect ( result ! . structure . functions ) . toHaveLength ( 1 ) ;
130+ expect ( result ! . callGraph ) . toHaveLength ( 1 ) ;
131+ } ) ;
132+
133+ it ( "analyzeFileFull returns null when the plugin lacks the method (caller falls back)" , ( ) => {
134+ const registry = new PluginRegistry ( ) ;
135+ registry . register ( createMockPlugin ( "ts-plugin" , [ "typescript" ] ) ) ;
136+ const result = registry . analyzeFileFull ( "src/test.ts" , "const x = 1;" ) ;
137+ expect ( result ) . toBeNull ( ) ;
138+ } ) ;
139+
140+ it ( "analyzeFileFull returns null for unsupported files" , ( ) => {
141+ const registry = new PluginRegistry ( ) ;
142+ registry . register ( createMockPlugin ( "ts-plugin" , [ "typescript" ] ) ) ;
143+ const result = registry . analyzeFileFull ( "main.py" , "print('hello')" ) ;
144+ expect ( result ) . toBeNull ( ) ;
145+ } ) ;
146+
115147 it ( "unregister rebuilds language map correctly" , ( ) => {
116148 const registry = new PluginRegistry ( ) ;
117149 const plugin1 = createMockPlugin ( "plugin1" , [ "typescript" , "javascript" ] ) ;
0 commit comments