From 5e4898826c7632817f1bb26d028021327fff767f Mon Sep 17 00:00:00 2001 From: Farhad Date: Wed, 5 Aug 2026 22:15:53 -0400 Subject: [PATCH] Add PostgreSQL language support --- README.md | 4 ++-- package.json | 13 +++++++++++++ src/shared.ts | 2 ++ src/webview/markdownEngine.ts | 10 +++++++--- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 623e95f2..5039b4d2 100644 --- a/README.md +++ b/README.md @@ -131,9 +131,9 @@ Thanks for [@yihong0618](https://github.com/yihong0618) provided a workaround wh ## Settings | Setting Name | Description | Default Value | -| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | +| --------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------------ | | `leetcode.hideSolved` | Specify to hide the solved problems or not | `false` | -| `leetcode.defaultLanguage` | Specify the default language used to solve the problem. Supported languages are: `bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `php`, `python`,`python3`,`ruby`,`rust`, `scala`, `swift`, `typescript` | `N/A` | +| `leetcode.defaultLanguage` | Specify the default language used to solve the problem. Supported languages are: `bash`, `c`, `cpp`, `csharp`, `golang`, `java`, `javascript`, `kotlin`, `mysql`, `postgresql`, `php`, `python`,`python3`,`ruby`,`rust`, `scala`, `swift`, `typescript` | `N/A` | | `leetcode.useWsl` | Specify whether to use WSL or not | `false` | | `leetcode.endpoint` | Specify the active endpoint. Supported endpoints are: `leetcode`, `leetcode-cn` | `leetcode` | | `leetcode.workspaceFolder` | Specify the path of the workspace folder to store the problem files. | `""` | diff --git a/package.json b/package.json index 53552b74..387c631d 100644 --- a/package.json +++ b/package.json @@ -311,6 +311,7 @@ "javascript", "kotlin", "mysql", + "postgresql", "php", "python", "python3", @@ -535,6 +536,18 @@ }, "minProperties": 1 }, + "postgresql": { + "type": "object", + "properties": { + "folder": { + "type": "string" + }, + "filename": { + "type": "string" + } + }, + "minProperties": 1 + }, "php": { "type": "object", "properties": { diff --git a/src/shared.ts b/src/shared.ts index e8b59d89..e4b3bad8 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -29,6 +29,7 @@ export const languages: string[] = [ "javascript", "kotlin", "mysql", + "postgresql", "php", "python", "python3", @@ -49,6 +50,7 @@ export const langExt: Map = new Map([ ["javascript", "js"], ["kotlin", "kt"], ["mysql", "sql"], + ["postgresql", "sql"], ["php", "php"], ["python", "py"], ["python3", "py"], diff --git a/src/webview/markdownEngine.ts b/src/webview/markdownEngine.ts index 4c1db65b..4a025650 100644 --- a/src/webview/markdownEngine.ts +++ b/src/webview/markdownEngine.ts @@ -78,11 +78,15 @@ class MarkdownEngine implements vscode.Disposable { highlight: (code: string, lang?: string): string => { switch (lang && lang.toLowerCase()) { case "mysql": - lang = "sql"; break; + case "postgresql": + lang = "sql"; + break; case "json5": - lang = "json"; break; + lang = "json"; + break; case "python3": - lang = "python"; break; + lang = "python"; + break; } if (lang && hljs.getLanguage(lang)) { try {