11import createTSServerInstance from './utils/server.js' ;
22import { FILES } from "./utils/testconfig.js" ;
33
4- const tsServer = createTSServerInstance ( ) ;
4+ const tsServer = createTSServerInstance ( false ) ;
55await tsServer . init ( ) ;
66console . log ( 'server intializeed' ) ;
77
@@ -115,7 +115,7 @@ for (let file of FILES) {
115115 const getOutliningSpansResponse = await tsServer . getOutliningSpans ( file . getOutliningSpans . fileName ) ;
116116 console . log ( 'getOutliningSpansResponse' , JSON . stringify ( getOutliningSpansResponse ) ) ;
117117 const todoCommentsResponse = await tsServer . todoComments ( file . todoComments . fileName , file . todoComments . descriptors ) ;
118- console . log ( 'todoCommentsResponse' , JSON . stringify ( todoCommentsResponse ) ) ;
118+ console . log ( 'todoCommentsResponse' , JSON . stringify ( todoCommentsResponse ) ) ;
119119
120120 const indentationsResponse = await tsServer . indentation ( file . indentation . fileName , file . indentation . line , file . indentation . offset , file . indentation . options ) ;
121121 console . log ( 'indentationsResponse' , JSON . stringify ( indentationsResponse ) ) ;
@@ -124,9 +124,29 @@ for (let file of FILES) {
124124 const docCommentTemplateResponse = await tsServer . docCommentTemplate ( file . docCommentTemplate . fileName , file . docCommentTemplate . line , file . docCommentTemplate . offset ) ;
125125 console . log ( 'docCommentTemplateResponse' , JSON . stringify ( docCommentTemplateResponse ) ) ;
126126
127- const setCompilerOptionsForInferredProjectsResponse = await tsServer . setCompilerOptionsForInferredProjects ( file . setCompilerOptionsForInferredProjects . options , file . setCompilerOptionsForInferredProjects . projectRootPath ) ;
128- console . log ( 'setCompilerOptionsForInferredProjectsResponse' , JSON . stringify ( setCompilerOptionsForInferredProjectsResponse ) ) ;
127+ /* const setCompilerOptionsForInferredProjectsResponse = await tsServer.setCompilerOptionsForInferredProjects(file.setCompilerOptionsForInferredProjects.options, file.setCompilerOptionsForInferredProjects.projectRootPath);
128+ console.log('setCompilerOptionsForInferredProjectsResponse', JSON.stringify(setCompilerOptionsForInferredProjectsResponse));*/
129129
130+ //TODO: Revisit
131+ /* await tsServer.openFile(file.getCodeFixes.fileName);
132+ const getCodeFixesResponse = await tsServer.getCodeFixes(file.getCodeFixes.fileName, file.getCodeFixes.startLine, file.getCodeFixes.endLine, file.getCodeFixes.endLine, file.getCodeFixes.endOffset, file.getCodeFixes.errorCodes);
133+ console.log('getCodeFixesResponse', JSON.stringify(getCodeFixesResponse));*/
130134
135+ // TODO: Revisit as it is used along with getCodeFixes in vscode
136+ /* await tsServer.openFile(file.getCombinedCodeFix.scope.args.file);
137+ const getCombinedCodeFixResponse = await tsServer.getCombinedCodeFix(file.getCombinedCodeFix.fileName, file.getCombinedCodeFix.fixId, file.getCombinedCodeFix.scope);
138+ console.log('getCombinedCodeFixResponse', JSON.stringify(getCombinedCodeFixResponse));*/
139+
140+ const getSupportedCodeFixesResponse = await tsServer . getSupportedCodeFixes ( file . getSupportedCodeFixes . file ) ;
141+ console . log ( 'getSupportedCodeFixesResponse' , JSON . stringify ( getSupportedCodeFixesResponse ) ) ;
142+
143+ await tsServer . openFile ( file . getApplicableRefactors . filePath ) ;
144+ const getApplicableRefactorsResponse = await tsServer . getApplicableRefactors ( file . getApplicableRefactors . filePath , file . getApplicableRefactors . line , file . getApplicableRefactors . offset /*, file.getApplicableRefactors.triggerReason, file.getApplicableRefactors.kind, file.getApplicableRefactors.includeInteractiveActions*/ ) ;
145+ console . log ( 'getApplicableRefactorsResponse' , JSON . stringify ( getApplicableRefactorsResponse ) ) ;
146+
147+ //TODO: Write working use case with editor
148+ await tsServer . openFile ( file . getEditsForRefactor . filePath ) ;
149+ const getEditsForRefactorResponse = await tsServer . getEditsForRefactor ( file . getEditsForRefactor . filePath , file . getEditsForRefactor . refactor , file . getEditsForRefactor . action , file . getEditsForRefactor . startLine , file . getEditsForRefactor . startOffset , file . getEditsForRefactor . endLine , file . getEditsForRefactor . endOffset , file . getEditsForRefactor . interactiveRefactorArguments ) ;
150+ console . log ( 'getEditsForRefactorResponse' , JSON . stringify ( getEditsForRefactorResponse ) ) ;
131151}
132152//tsServer.exitServer();
0 commit comments