From 753422ebf448ff792de9b4c41490447729b57cc1 Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Wed, 5 Mar 2025 08:28:52 +0800 Subject: [PATCH] refactor: remove unused editor and language config files --- src/config/editor/language.ts | 3 --- src/config/editor/path.ts | 6 ------ src/config/editor/value.ts | 16 ---------------- src/config/lsp/language-server.ts | 29 ----------------------------- src/constants/language.tsx | 16 ---------------- 5 files changed, 70 deletions(-) delete mode 100644 src/config/editor/language.ts delete mode 100644 src/config/editor/path.ts delete mode 100644 src/config/editor/value.ts delete mode 100644 src/config/lsp/language-server.ts delete mode 100644 src/constants/language.tsx diff --git a/src/config/editor/language.ts b/src/config/editor/language.ts deleted file mode 100644 index 1afef46..0000000 --- a/src/config/editor/language.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SUPPORTED_LANGUAGES, SupportedLanguage } from "@/constants/language"; - -export const DEFAULT_EDITOR_LANGUAGE: SupportedLanguage = SUPPORTED_LANGUAGES[0].id; diff --git a/src/config/editor/path.ts b/src/config/editor/path.ts deleted file mode 100644 index 91c1089..0000000 --- a/src/config/editor/path.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SupportedLanguage } from "@/constants/language"; - -export const DEFAULT_EDITOR_PATH: Record = { - c: "file:///main.c", - cpp: "file:///main.cpp", -}; diff --git a/src/config/editor/value.ts b/src/config/editor/value.ts deleted file mode 100644 index 6bc1e45..0000000 --- a/src/config/editor/value.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { SupportedLanguage } from "@/constants/language"; - -export const DEFAULT_EDITOR_VALUE: Record = { - c: `/** - * Note: The returned array must be malloced, assume caller calls free(). - */ -int* twoSum(int* nums, int numsSize, int target, int* returnSize) { - -}`, - cpp: `class Solution { -public: - vector twoSum(vector& nums, int target) { - - } -};`, -}; diff --git a/src/config/lsp/language-server.ts b/src/config/lsp/language-server.ts deleted file mode 100644 index 1ad594f..0000000 --- a/src/config/lsp/language-server.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { SupportedLanguage } from '@/constants/language' - -export interface LanguageServerConfig { - id: SupportedLanguage - label: string - hostname: string - protocol: string - port: number | null - path: string | null -} - -export const SUPPORTED_LANGUAGE_SERVERS: LanguageServerConfig[] = [ - { - id: "c", - label: "C", - protocol: process.env.NEXT_PUBLIC_LSP_C_PROTOCOL || "ws", - hostname: process.env.NEXT_PUBLIC_LSP_C_HOSTNAME || "localhost", - port: process.env.NEXT_PUBLIC_LSP_C_PORT ? parseInt(process.env.NEXT_PUBLIC_LSP_C_PORT, 10) : 4594, - path: process.env.NEXT_PUBLIC_LSP_C_PATH || "/clangd", - }, - { - id: "cpp", - label: "C++", - protocol: process.env.NEXT_PUBLIC_LSP_CPP_PROTOCOL || "ws", - hostname: process.env.NEXT_PUBLIC_LSP_CPP_HOSTNAME || "localhost", - port: process.env.NEXT_PUBLIC_LSP_CPP_PORT ? parseInt(process.env.NEXT_PUBLIC_LSP_CPP_PORT, 10) : 4595, - path: process.env.NEXT_PUBLIC_LSP_CPP_PATH || "/clangd", - }, -]; diff --git a/src/constants/language.tsx b/src/constants/language.tsx deleted file mode 100644 index a121149..0000000 --- a/src/constants/language.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { COriginal, CplusplusOriginal } from 'devicons-react' - -export const SUPPORTED_LANGUAGES = [ - { - id: "c", - label: "C", - icon: