From e5ac9c65a270cecb573abba834821b8685976533 Mon Sep 17 00:00:00 2001 From: Jeet Dekivadia Date: Fri, 29 May 2026 20:55:21 -0700 Subject: [PATCH 1/3] Add slang-server configuration schema --- src/api/json/catalog.json | 11 + .../invalid-doc-comment-format.json | 5 + src/schemas/json/slang-server.json | 206 ++++++++++++++++++ src/test/slang-server/server.json | 36 +++ 4 files changed, 258 insertions(+) create mode 100644 src/negative_test/slang-server/invalid-doc-comment-format.json create mode 100644 src/schemas/json/slang-server.json create mode 100644 src/test/slang-server/server.json diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index 30dd2415cc8..4ff424c0052 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -6500,6 +6500,17 @@ "description": "A manifest file containing the settings for a Slack app", "url": "https://www.schemastore.org/slack-app-manifest.json" }, + { + "name": "slang-server", + "description": "Configuration file for slang-server, a SystemVerilog language server", + "fileMatch": [ + ".slang/server.json", + ".slang/local/server.json", + "**/.slang/server.json", + "**/.slang/local/server.json" + ], + "url": "https://www.schemastore.org/slang-server.json" + }, { "name": "skyuxconfig.json", "description": "SKY UX CLI configuration file", diff --git a/src/negative_test/slang-server/invalid-doc-comment-format.json b/src/negative_test/slang-server/invalid-doc-comment-format.json new file mode 100644 index 00000000000..0c28d4242da --- /dev/null +++ b/src/negative_test/slang-server/invalid-doc-comment-format.json @@ -0,0 +1,5 @@ +{ + "hovers": { + "docCommentFormat": "html" + } +} diff --git a/src/schemas/json/slang-server.json b/src/schemas/json/slang-server.json new file mode 100644 index 00000000000..bb90704dbcd --- /dev/null +++ b/src/schemas/json/slang-server.json @@ -0,0 +1,206 @@ +{ + "$id": "https://www.schemastore.org/slang-server.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/Config", + "definitions": { + "Config": { + "type": "object", + "properties": { + "flags": { + "type": "string", + "description": "Flags to pass to slang" + }, + "indexGlobs": { + "type": "array", + "description": "DEPRECATED: Use 'index' instead. Globs of what to index. By default, indexes all .sv and .svh files in the workspace.", + "items": { + "type": "string" + } + }, + "index": { + "type": "array", + "description": "Index configurations; by default indexes all .sv, .svh, .v, and .vh files in the workspace.", + "items": { + "$ref": "#/definitions/Config__IndexConfig" + } + }, + "excludeDirs": { + "type": "array", + "description": "DEPRECATED: Use 'index' instead. Directories to exclude.", + "items": { + "type": "string" + } + }, + "indexingThreads": { + "type": "integer", + "description": "Thread count to use for indexing" + }, + "build": { + "description": "Build file to use", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "buildPattern": { + "description": "Build file glob pattern, e.g. `builds/{}.f`. Used for selecting build files. If omitted and no other build source is configured, defaults to matching all `.f` files in the workspace.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "buildRelativePaths": { + "description": "Whether build files use paths relative to that file", + "type": "boolean" + }, + "wavesPattern": { + "description": "Waveform file glob to open given a build. Name and top variables can be passed with {name}, {top}.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "wcpCommand": { + "description": "Waveform viewer command ({} will be replaced with the WCP port), used for direct wcp connection with neovim and surfer.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "hovers": { + "$ref": "#/definitions/Config__HoverConfig", + "description": "Hover behavior settings" + }, + "inlayHints": { + "$ref": "#/definitions/Config__InlayHints", + "description": "Inline hints for things like ordered arguments, wildcard ports, and others" + }, + "builds": { + "type": "array", + "description": "Builds for direct .f selection or command-based .f generation", + "items": { + "$ref": "#/definitions/Config__Build" + } + } + }, + "required": [] + }, + "Config__Build": { + "type": "object", + "properties": { + "name": { + "description": "Optional name used for generated build files and UI labels", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "glob": { + "type": "string", + "description": "Glob pattern to find files, like .f files or makefiles" + }, + "command": { + "type": "string", + "description": "Optional command that produces .f content on stdout when passed the selected file" + } + }, + "required": [] + }, + "Config__HoverConfig": { + "type": "object", + "properties": { + "docCommentFormat": { + "description": "How to render leading doc comments in hovers: 'markdown' renders as markdown, 'plaintext' escapes markdown characters, 'raw' shows the comment text verbatim including comment markers.", + "oneOf": [ + { + "description": "Strip comment markers and escape markdown characters so the text renders as-is.", + "const": "plaintext" + }, + { + "description": "Strip comment markers and render the contents as markdown.", + "const": "markdown" + }, + { + "description": "Show the comment text verbatim, including comment markers, in a code block.", + "const": "raw" + } + ] + } + }, + "required": [] + }, + "Config__IndexConfig": { + "type": "object", + "properties": { + "dirs": { + "type": "array", + "description": "Directories to index", + "items": { + "type": "string" + } + }, + "excludeDirs": { + "description": "Directories to exclude; only supports single directory names and applies to all path levels", + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [] + }, + "Config__InlayHints": { + "type": "object", + "properties": { + "portTypes": { + "description": "Hints for port types", + "type": "boolean" + }, + "orderedInstanceNames": { + "description": "Hints for names of ordered ports and params", + "type": "boolean" + }, + "wildcardNames": { + "description": "Hints for port names in wildcard (.*) ports", + "type": "boolean" + }, + "funcArgNames": { + "type": "integer", + "description": "Function argument hints: 0=off, N=only calls with >=N args" + }, + "macroArgNames": { + "type": "integer", + "description": "Macro argument hints: 0=off, N=only calls with >=N args" + } + }, + "required": [] + } + } +} diff --git a/src/test/slang-server/server.json b/src/test/slang-server/server.json new file mode 100644 index 00000000000..9f69356df42 --- /dev/null +++ b/src/test/slang-server/server.json @@ -0,0 +1,36 @@ +{ + "flags": "-Wall", + "index": [ + { + "dirs": ["rtl", "verification"], + "excludeDirs": ["build"] + } + ], + "indexingThreads": 4, + "build": "sim/top.f", + "buildPattern": "builds/{}.f", + "buildRelativePaths": true, + "wavesPattern": "waves/{name}-{top}.fst", + "wcpCommand": "surfer --wcp {}", + "hovers": { + "docCommentFormat": "markdown" + }, + "inlayHints": { + "portTypes": true, + "orderedInstanceNames": true, + "wildcardNames": true, + "funcArgNames": 2, + "macroArgNames": 1 + }, + "builds": [ + { + "name": "simulation", + "glob": "sim/*.f" + }, + { + "name": "generated", + "glob": "builds/*.mk", + "command": "make filelist" + } + ] +} From a61b76017428781d838d592cb3fe4fd182e6ae76 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 03:58:39 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/schemas/json/slang-server.json | 2 +- src/test/slang-server/server.json | 46 +++++++++++++++--------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/schemas/json/slang-server.json b/src/schemas/json/slang-server.json index bb90704dbcd..ca6106e2889 100644 --- a/src/schemas/json/slang-server.json +++ b/src/schemas/json/slang-server.json @@ -1,6 +1,6 @@ { - "$id": "https://www.schemastore.org/slang-server.json", "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://www.schemastore.org/slang-server.json", "$ref": "#/definitions/Config", "definitions": { "Config": { diff --git a/src/test/slang-server/server.json b/src/test/slang-server/server.json index 9f69356df42..b1a057fac48 100644 --- a/src/test/slang-server/server.json +++ b/src/test/slang-server/server.json @@ -1,5 +1,22 @@ { + "build": "sim/top.f", + "buildPattern": "builds/{}.f", + "buildRelativePaths": true, + "builds": [ + { + "glob": "sim/*.f", + "name": "simulation" + }, + { + "command": "make filelist", + "glob": "builds/*.mk", + "name": "generated" + } + ], "flags": "-Wall", + "hovers": { + "docCommentFormat": "markdown" + }, "index": [ { "dirs": ["rtl", "verification"], @@ -7,30 +24,13 @@ } ], "indexingThreads": 4, - "build": "sim/top.f", - "buildPattern": "builds/{}.f", - "buildRelativePaths": true, - "wavesPattern": "waves/{name}-{top}.fst", - "wcpCommand": "surfer --wcp {}", - "hovers": { - "docCommentFormat": "markdown" - }, "inlayHints": { - "portTypes": true, - "orderedInstanceNames": true, - "wildcardNames": true, "funcArgNames": 2, - "macroArgNames": 1 + "macroArgNames": 1, + "orderedInstanceNames": true, + "portTypes": true, + "wildcardNames": true }, - "builds": [ - { - "name": "simulation", - "glob": "sim/*.f" - }, - { - "name": "generated", - "glob": "builds/*.mk", - "command": "make filelist" - } - ] + "wavesPattern": "waves/{name}-{top}.fst", + "wcpCommand": "surfer --wcp {}" } From 091f5248defef54da41e5973a0415d82e913a2e1 Mon Sep 17 00:00:00 2001 From: Jeet Dekivadia Date: Fri, 29 May 2026 21:05:08 -0700 Subject: [PATCH 3/3] Fix slang-server catalog file matches --- src/api/json/catalog.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index 4ff424c0052..3e48957afbd 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -6503,12 +6503,7 @@ { "name": "slang-server", "description": "Configuration file for slang-server, a SystemVerilog language server", - "fileMatch": [ - ".slang/server.json", - ".slang/local/server.json", - "**/.slang/server.json", - "**/.slang/local/server.json" - ], + "fileMatch": ["**/.slang/server.json", "**/.slang/local/server.json"], "url": "https://www.schemastore.org/slang-server.json" }, {