A full-stack, open-source online judge platform designed to elevate college programming education.
Go to file
2025-03-02 11:41:19 +08:00
docker/lsp/clangd feat(docker): simplify docker compose commands and add compose.yml for service configuration 2025-02-21 19:56:49 +08:00
public docs: add placeholder .gitkeep file to 'public' folder 2025-02-20 01:31:14 +08:00
src feat(judge): add memory usage monitoring and handling 2025-03-02 01:40:25 +08:00
.dockerignore feat(docker): add Dockerfile and .dockerignore for containerized environment setup 2025-02-19 17:13:31 +08:00
.env.example fix(language-server): update configuration to use environment variables for WebSocket settings 2025-02-24 00:22:34 +08:00
.gitignore chore: update .gitignore to explicitly commit env files 2025-02-20 08:42:01 +08:00
bun.lock fix(deps): restrict shiki and @shikijs/monaco versions to <=2.5.0 due to API deprecation 2025-03-02 11:41:19 +08:00
components.json chore: initialize shadcn/ui 2025-02-19 09:07:30 +08:00
compose.yml feat(compose): add docker socket mount and root user permission configuration 2025-03-01 16:06:33 +08:00
demo.png chore: update demo image for improved visual representation 2025-02-26 14:43:32 +08:00
Dockerfile chore: update Dockerfile to specify Node.js v20 or higher for resolving ReferenceError 2025-02-20 08:54:37 +08:00
eslint.config.mjs chore: initialize the project 2025-02-19 09:00:15 +08:00
LICENSE chore: add MIT License file to the repository 2025-02-19 18:38:49 +08:00
next.config.ts feat(next.config): add dockerode to serverExternalPackages 2025-02-26 21:18:33 +08:00
package.json fix(deps): restrict shiki and @shikijs/monaco versions to <=2.5.0 due to API deprecation 2025-03-02 11:41:19 +08:00
postcss.config.mjs chore: initialize the project 2025-02-19 09:00:15 +08:00
README.md docs(readme): improve README with detailed WSL setup and package compatibility info 2025-03-02 11:39:59 +08:00
tailwind.config.ts chore: initialize shadcn/ui 2025-02-19 09:07:30 +08:00
tsconfig.json chore: initialize the project 2025-02-19 09:00:15 +08:00

monaco-editor-lsp-next

A seamless Next.js integration of the Monaco Editor with robust LSP support all without SSR hassles.

demo

⚠️ Important Notice for WSL Users

🐧 WSL Network Configuration

If you are using Windows Subsystem for Linux (WSL), it is essential to switch your network mode to Mirrored. Failing to do so may prevent the Monaco Editor from connecting to the LSP language servers due to potential IPv6 configuration conflicts.

Steps to Switch to "Mirrored" Mode:

  1. Open your WSL settings. ⚙️
  2. Navigate to the Network section. 🌐
  3. Change the network mode to Mirrored. 🔄
  4. Restart WSL. 💻

Once these steps are completed, the Monaco Editor should connect smoothly to the LSP language servers. Enjoy! 🎉

🚀 Quick Start Guide

# Clone the repository
git clone https://github.com/cfngc4594/monaco-editor-lsp-next
cd monaco-editor-lsp-next

# Build and start containers in detached mode
docker compose up -d --build

🔧 Manual Setup

# Clone the repository
git clone https://github.com/cfngc4594/monaco-editor-lsp-next
cd monaco-editor-lsp-next

# Build and start specific containers (lsp-c and lsp-cpp) in detached mode
docker compose up -d --build lsp-c lsp-cpp

# Install project dependencies using the Bun package manager
bun install

# Launch the development server
bun run dev

⚙️ Configuration

LSP Server Settings

Language LSP Server Port
C clangd 4594
C++ clangd 4595

📦 Package Compatibility

🎨 Shiki API Deprecation Notice

The syntax highlighting feature relies on rehype-pretty-code, which uses the deprecated getHighlighter API from shiki. This API was removed as of shiki@3.0.0+.

Key Details:

  • Affected Component: src/components/mdx-preview.tsx
  • Dependency Chain: rehype-pretty-codeshiki@legacy
  • Version Constraints:
    "shiki": "<=2.5.0"
    "@shikijs/monaco": "<=2.5.0"
    

Developer Note:
Although newer shiki versions (3.0.0+) have introduced createHighlighter and getSingletonHighlighter APIs, upgrading manually may disrupt functionality until rehype-pretty-code adapts to these changes. For updates, please monitor the rehype-pretty-code repository.