2025-02-19 10:22:27 +00:00
|
|
|
<div align="center">
|
|
|
|
|
2025-02-19 05:55:33 +00:00
|
|
|
# monaco-editor-lsp-next
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
✨ A Next.js integration of Monaco Editor with LSP support, free from SSR issues.
|
|
|
|
|
2025-02-20 17:48:34 +00:00
|
|
|

|
2025-02-20 16:56:03 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
</div>
|
|
|
|
|
2025-02-21 03:25:58 +00:00
|
|
|
## ⚠️ Important Notice for WSL Users!
|
|
|
|
|
|
|
|
If you're using Windows Subsystem for Linux (WSL), it's **crucial** to switch your network mode to "Mirrored".
|
|
|
|
|
|
|
|
Otherwise, the Monaco Editor might fail to connect to the LSP language servers.
|
|
|
|
|
|
|
|
This is typically due to IPv6 configuration issues.
|
|
|
|
|
|
|
|
To change your WSL network mode, follow these steps:
|
|
|
|
|
|
|
|
1. Open WSL settings. ⚙️
|
|
|
|
2. Navigate to the "Network" section. 🌐
|
|
|
|
3. Change the network mode to "Mirrored". 🔄
|
|
|
|
4. Restart WSL. 💻
|
|
|
|
|
|
|
|
After completing these steps, the Monaco Editor should be able to connect to the LSP language servers without any problems. 🎉
|
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
## 🚀 Quick Start
|
|
|
|
|
|
|
|
### 🐳 Using Docker (Recommended)
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
```sh
|
|
|
|
# Clone repository
|
|
|
|
git clone https://github.com/cfngc4594/monaco-editor-lsp-next
|
|
|
|
cd monaco-editor-lsp-next
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
# Start containers in detached mode
|
|
|
|
docker compose -f ./docker/compose.yml up -d
|
|
|
|
```
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-20 06:18:13 +00:00
|
|
|
### 🔧 Manual Setup
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
```sh
|
2025-02-19 10:29:04 +00:00
|
|
|
# Clone repository
|
2025-02-19 10:22:27 +00:00
|
|
|
git clone https://github.com/cfngc4594/monaco-editor-lsp-next
|
|
|
|
cd monaco-editor-lsp-next
|
2025-02-19 10:29:04 +00:00
|
|
|
|
|
|
|
# Start specific containers (lsp-c and lsp-cpp) in detached mode
|
2025-02-19 10:22:27 +00:00
|
|
|
docker compose -f ./docker/compose.yml up -d lsp-c lsp-cpp
|
2025-02-19 10:29:04 +00:00
|
|
|
|
|
|
|
# Install project dependencies using Bun package manager
|
2025-02-19 10:22:27 +00:00
|
|
|
bun install
|
2025-02-19 10:29:04 +00:00
|
|
|
|
|
|
|
# Run the development server
|
2025-02-19 10:22:27 +00:00
|
|
|
bun run dev
|
|
|
|
```
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
## ⚙️ Configuration
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
### LSP Server Settings
|
2025-02-19 01:00:15 +00:00
|
|
|
|
2025-02-19 10:22:27 +00:00
|
|
|
| **Language** | **LSP Server** | **Port** |
|
|
|
|
|----------------|------------------|------------|
|
|
|
|
| `C` | `clangd` | `4594` |
|
|
|
|
| `C++` | `clangd` | `4595` |
|