feat(language-server): add environment variable support for configuration
This commit is contained in:
parent
470fa306c2
commit
2a47b469b0
@ -4,17 +4,17 @@ import { LanguageServerMetadata } from "@/types/language-server";
|
||||
|
||||
const LanguageServerConfig: Record<EditorLanguage, LanguageServerMetadata> = {
|
||||
[EditorLanguage.C]: {
|
||||
protocol: "ws",
|
||||
hostname: "localhost",
|
||||
port: 4594,
|
||||
path: "/clangd",
|
||||
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",
|
||||
lang: EditorLanguageConfig[EditorLanguage.C],
|
||||
},
|
||||
[EditorLanguage.CPP]: {
|
||||
protocol: "ws",
|
||||
hostname: "localhost",
|
||||
port: 4595,
|
||||
path: "/clangd",
|
||||
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",
|
||||
lang: EditorLanguageConfig[EditorLanguage.CPP],
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user