From ec0a970b9a878c95d887309ba980a316e6c7c8d2 Mon Sep 17 00:00:00 2001
From: Felix Eckhofer <felix@eckhofer.com>
Date: Thu, 13 Mar 2025 10:47:11 +0100
Subject: [PATCH] Enable LSP in devcontainer and apply rubocop by default

---
 .devcontainer/devcontainer.json | 12 ++++++++++--
 .vscode/settings.json           |  7 +++++++
 2 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 .vscode/settings.json

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 030f87a..9b46bf7 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -12,8 +12,16 @@
 
 	// Features to add to the dev container. More info: https://containers.dev/features.
 	"features": {
-    	"ghcr.io/rails/devcontainer/features/activestorage": {}
-  	}
+		"ghcr.io/rails/devcontainer/features/activestorage": {}
+	},
+
+	"customizations": {
+		"vscode": {
+			"extensions": [
+				"Shopify.ruby-lsp"
+			]
+		}
+	}
 
 	// Use 'forwardPorts' to make a list of ports inside the container available locally.
 	// "forwardPorts": [],
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..a0b0274
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,7 @@
+{
+    "rubyLsp.formatter": "rubocop",
+    "[ruby]": {
+        "editor.defaultFormatter": "Shopify.ruby-lsp",
+        "editor.formatOnSave": true,
+      },
+}
-- 
GitLab