@@ -3,7 +3,6 @@ import ts from "typescript"
33import { GeneratorEvent } from "../helpers/generator-event-manager.js"
44import AbstractGenerator from "./index.js"
55import { minimatch } from "minimatch"
6- import AiGenerator from "../helpers/ai-generator.js"
76import getBasePath from "../../utils/get-base-path.js"
87
98/**
@@ -25,7 +24,6 @@ class DocblockGenerator extends AbstractGenerator {
2524 if ( file . isDeclarationFile || ! this . isFileIncluded ( file . fileName ) ) {
2625 return
2726 }
28- let aiGenerator : AiGenerator | undefined
2927
3028 console . log ( `[Docblock] Generating for ${ file . fileName } ...` )
3129
@@ -35,10 +33,6 @@ class DocblockGenerator extends AbstractGenerator {
3533 const origFileText = file . getFullText ( ) . trim ( )
3634 const fileNodes : ts . Node [ ] = [ file ]
3735
38- if ( this . options . generateExamples ) {
39- aiGenerator = new AiGenerator ( )
40- }
41-
4236 // since typescript's compiler API doesn't support
4337 // async processes, we have to retrieve the nodes first then
4438 // traverse them separately.
@@ -55,14 +49,9 @@ class DocblockGenerator extends AbstractGenerator {
5549 let docComment : string | undefined
5650
5751 if ( nodeKindGenerator ?. canDocumentNode ( node ) ) {
58- if ( aiGenerator ) {
59- const nodeFiles = aiGenerator . getNodeFiles ( file )
60- await aiGenerator . initAssistant ( nodeFiles )
61- }
6252 // initialize assistant only when needed
6353 // if previously initialized, calling the method does nothing
6454 docComment = await nodeKindGenerator . getDocBlock ( node , {
65- aiGenerator,
6655 addEnd : true ,
6756 } )
6857 if ( docComment . length ) {
@@ -98,10 +87,6 @@ class DocblockGenerator extends AbstractGenerator {
9887 )
9988 }
10089
101- if ( aiGenerator ) {
102- await aiGenerator . destroyAssistant ( )
103- }
104-
10590 // add comments to file
10691 const newNodeText = printer . printNode ( ts . EmitHint . Unspecified , file , file )
10792
0 commit comments