-
Notifications
You must be signed in to change notification settings - Fork 20
Configure TypeScript and Python language servers in Serena container #809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e3abf69
11e60ab
9b5a1b5
b7a752d
797eab6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -53,6 +53,28 @@ RUN mkdir -p /workspace /tmp/serena-cache /root/.serena | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV SERENA_WORKSPACE=/workspace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ENV SERENA_CACHE_DIR=/tmp/serena-cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create a startup script that ensures multi-language support | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This script will initialize the workspace with Go, TypeScript, and Python if not already configured | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUN printf '#!/bin/bash\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set -e\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Ensure .serena directory exists in workspace\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p /workspace/.serena\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+61
to
+63
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if project.yml needs to be created or updated\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create/update if: file does not exist, OR it is missing any of the three required languages\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ ! -f /workspace/.serena/project.yml ] || \\\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ! grep -q "^- go$" /workspace/.serena/project.yml || \\\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ! grep -q "^- typescript$" /workspace/.serena/project.yml || \\\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ! grep -q "^- python$" /workspace/.serena/project.yml; then\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Initializing Serena project with Go, TypeScript, and Python support..."\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| printf "languages:\\n- go\\n- typescript\\n- python\\n" > /workspace/.serena/project.yml\n\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+64
to
+71
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if project.yml needs to be created or updated\n\ | |
| # Create/update if: file does not exist, OR it is missing any of the three required languages\n\ | |
| if [ ! -f /workspace/.serena/project.yml ] || \\\n\ | |
| ! grep -q "^- go$" /workspace/.serena/project.yml || \\\n\ | |
| ! grep -q "^- typescript$" /workspace/.serena/project.yml || \\\n\ | |
| ! grep -q "^- python$" /workspace/.serena/project.yml; then\n\ | |
| echo "Initializing Serena project with Go, TypeScript, and Python support..."\n\ | |
| printf "languages:\\n- go\\n- typescript\\n- python\\n" > /workspace/.serena/project.yml\n\ | |
| PROJECT_FILE="/workspace/.serena/project.yml"\n\ | |
| \n\ | |
| # If project.yml does not exist, create it with the required languages\n\ | |
| if [ ! -f "$PROJECT_FILE" ]; then\n\ | |
| echo "Creating new Serena project with Go, TypeScript, and Python support..."\n\ | |
| printf "languages:\\n- go\\n- typescript\\n- python\\n" > "$PROJECT_FILE"\n\ | |
| else\n\ | |
| echo "Ensuring Serena project has Go, TypeScript, and Python language support..."\n\ | |
| NEED_UPDATE=false\n\ | |
| \n\ | |
| grep -q "^- go$" "$PROJECT_FILE" || NEED_UPDATE=true\n\ | |
| grep -q "^- typescript$" "$PROJECT_FILE" || NEED_UPDATE=true\n\ | |
| grep -q "^- python$" "$PROJECT_FILE" || NEED_UPDATE=true\n\ | |
| \n\ | |
| if [ "$NEED_UPDATE" = true ]; then\n\ | |
| echo "Appending missing language entries to existing Serena project.yml..."\n\ | |
| {\n\ | |
| echo ""\n\ | |
| echo "# The following languages were added automatically by Serena init:"\n\ | |
| echo "languages:"\n\ | |
| grep -q "^- go$" "$PROJECT_FILE" || echo "- go"\n\ | |
| grep -q "^- typescript$" "$PROJECT_FILE" || echo "- typescript"\n\ | |
| grep -q "^- python$" "$PROJECT_FILE" || echo "- python"\n\ | |
| } >> "$PROJECT_FILE"\n\ | |
| fi\n\ |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The init script hardcodes /workspace paths instead of using SERENA_WORKSPACE (which is set just above and can be overridden by users). Using the env var (with a default) would keep behavior consistent if the workspace location changes.
| # Ensure .serena directory exists in workspace\n\ | |
| mkdir -p /workspace/.serena\n\ | |
| \n\ | |
| # Check if project.yml needs to be created or updated\n\ | |
| # Create/update if: file does not exist, OR it is missing any of the three required languages\n\ | |
| if [ ! -f /workspace/.serena/project.yml ] || \\\n\ | |
| ! grep -q "^- go$" /workspace/.serena/project.yml || \\\n\ | |
| ! grep -q "^- typescript$" /workspace/.serena/project.yml || \\\n\ | |
| ! grep -q "^- python$" /workspace/.serena/project.yml; then\n\ | |
| echo "Initializing Serena project with Go, TypeScript, and Python support..."\n\ | |
| printf "languages:\\n- go\\n- typescript\\n- python\\n" > /workspace/.serena/project.yml\n\ | |
| # Determine workspace directory (allow override via SERENA_WORKSPACE)\n\ | |
| WORKSPACE="${SERENA_WORKSPACE:-/workspace}"\n\ | |
| \n\ | |
| # Ensure .serena directory exists in workspace\n\ | |
| mkdir -p "$WORKSPACE/.serena"\n\ | |
| \n\ | |
| # Check if project.yml needs to be created or updated\n\ | |
| # Create/update if: file does not exist, OR it is missing any of the three required languages\n\ | |
| if [ ! -f "$WORKSPACE/.serena/project.yml" ] || \\\n\ | |
| ! grep -q "^- go$" "$WORKSPACE/.serena/project.yml" || \\\n\ | |
| ! grep -q "^- typescript$" "$WORKSPACE/.serena/project.yml" || \\\n\ | |
| ! grep -q "^- python$" "$WORKSPACE/.serena/project.yml"; then\n\ | |
| echo "Initializing Serena project with Go, TypeScript, and Python support..."\n\ | |
| printf "languages:\\n- go\\n- typescript\\n- python\\n" > "$WORKSPACE/.serena/project.yml"\n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note says the container “successfully creates
.serena/project.ymlwhen mounting any workspace to/workspace”, but the documented configuration mounts/workspaceread-only (:ro), in which case the init script cannot write the file. Update the notes to clarify the workspace (or at least/workspace/.serena) must be writable, or that the script skips initialization on read-only mounts.