File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,18 @@ function createTSServerInstance() {
1212 const pendingCommands = new Map ( ) ;
1313
1414 /**
15- * Initializes the TypeScript Server process.
15+ * Initializes the TypeScript Server instance.
16+ *
17+ * This function starts a new process for the TypeScript Server using Node's `child_process.spawn`.
18+ * It sets up listeners for the 'stdout' and 'stderr' streams of the TypeScript Server process,
19+ * handling incoming data and errors respectively. It also handles the 'close' event of the process.
20+ * The function configures a timeout to reject the promise if the server does not start within a specified time.
21+ *
22+ * @param {string } [node=""] - The path to the Node.js executable. If not provided, defaults to 'node'.
23+ * @param {string } [tsServer=""] - The path to the TypeScript Server executable. If not provided,
24+ * defaults to the 'tsserver' path in the 'node_modules' directory.
25+ * @returns {Promise<void> } A promise that resolves when the TypeScript Server is ready,
26+ * or rejects if there is an error or timeout.
1627 */
1728 function initTSServer ( node = "" , tsServer = "" ) {
1829 return new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments