optimize code

This commit is contained in:
bobo.yang 2023-12-27 21:41:43 +08:00
parent 972827070e
commit 9116aed60b
2 changed files with 1 additions and 2 deletions

View File

@ -159,6 +159,7 @@ let server: http.Server | null = null;
export async function startRpcServer() {
server = http.createServer((req, res) => {
const parsedUrl = new URL(req.url!, `http://${req.headers.host}`);
logger.channel()?.info(`request: ${parsedUrl}`)
if (parsedUrl.pathname === '/favicon.ico') {
res.writeHead(204);
res.end();
@ -228,7 +229,6 @@ export async function startRpcServer() {
// eslint-disable-next-line @typescript-eslint/naming-convention
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(responseResult));
logger.channel()?.info(`result:${responseResult}`);
} catch (error) {
logger.channel()?.error(`Error: ${error}`);
logger.channel()?.show();

View File

@ -1,7 +1,6 @@
import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import { has } from 'mobx';
interface FunctionDefinition {
name: string;