2025-03-08 13:03:32 +00:00
|
|
|
import { EditorLanguage } from "@prisma/client";
|
2025-03-04 12:53:19 +00:00
|
|
|
import { EditorLanguageConfig } from "./editor-language";
|
|
|
|
import { LanguageServerMetadata } from "@/types/language-server";
|
|
|
|
|
|
|
|
const LanguageServerConfig: Record<EditorLanguage, LanguageServerMetadata> = {
|
2025-03-08 13:03:32 +00:00
|
|
|
[EditorLanguage.c]: {
|
2025-03-05 00:33:38 +00:00
|
|
|
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",
|
2025-03-08 13:03:32 +00:00
|
|
|
lang: EditorLanguageConfig[EditorLanguage.c],
|
2025-03-04 12:53:19 +00:00
|
|
|
},
|
2025-03-08 13:03:32 +00:00
|
|
|
[EditorLanguage.cpp]: {
|
2025-03-05 00:33:38 +00:00
|
|
|
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",
|
2025-03-08 13:03:32 +00:00
|
|
|
lang: EditorLanguageConfig[EditorLanguage.cpp],
|
2025-03-04 12:53:19 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default LanguageServerConfig;
|