{ "name": "herb-lsp", "displayName": "Herb LSP - HTML+ERB Language Tools", "description": "VS Code extension for connecting with the Herb Language Server and Language Tools for HTML+ERB files", "version": "0.11.2", "private": true, "license": "MIT", "pricing": "Free", "icon": "icon.png", "publisher": "marcoroth", "author": { "name": "Marco Roth" }, "engines": { "vscode": "^1.100.0" }, "extensionDependencies": [ "Shopify.ruby-lsp" ], "categories": [ "Programming Languages", "Linters", "Formatters" ], "keywords": [ "HTML", "Ruby", "ERB" ], "homepage": "https://herb-tools.dev", "bugs": "https://github.com/marcoroth/herb/issues/new?title=Package%20%60@herb-lsp-vscode%60:%20", "repository": { "type": "git", "url": "git+https://github.com/marcoroth/herb.git", "directory": "javascript/packages/vscode" }, "sponsor": { "url": "http://github.com/sponsors/marcoroth" }, "activationEvents": [ "onLanguage:erb", "onLanguage:html", "onCommand:herb.analyzeProject", "onCommand:herb.reprocessFile" ], "main": "./dist/extension.js", "contributes": { "configurationDefaults": { "[erb]": { "editor.formatOnType": true, "editor.quickSuggestions": { "other": true, "comments": false, "strings": true } } }, "configuration": { "type": "object", "title": "Herb (HTML+ERB)", "properties": { "languageServerHerb.linter.enabled": { "scope": "window", "type": "boolean", "default": true, "description": "Enable/disable the Herb Linter. The linter provides comprehensive HTML+ERB validation, enforces best practices, and catches common errors with a set of configurable rules, like proper tag nesting, required attributes, and ERB usage patterns.", "markdownDescription": "Enable/disable the [Herb Linter](https://herb-tools.dev/projects/linter). The linter provides comprehensive HTML+ERB validation, enforces best practices, and catches common errors with a set of configurable [rules](https://herb-tools.dev/linter/rules/), like proper tag nesting, required attributes, and ERB usage patterns.\n\n**Note**: This is a personal default. If a `.herb.yml` file exists in your project, its configuration takes precedence." }, "languageServerHerb.linter.fixOnSave": { "scope": "resource", "type": "boolean", "default": true, "description": "Automatically autofix correctable linter offenses when saving files.", "markdownDescription": "Automatically autofix correctable linter offenses when saving files." }, "languageServerHerb.formatter.enabled": { "scope": "resource", "type": "boolean", "default": false, "description": "Enable/disable document formatting using the Herb Formatter (Experimental Preview). WARNING: This formatter is experimental and may potentially corrupt files. Only use on files that can be restored via git or other version control.", "markdownDescription": "Enable/disable document formatting using the [Herb Formatter](https://herb-tools.dev/projects/formatter) **(Experimental Preview)**. ⚠️ **WARNING**: This formatter is experimental and may potentially corrupt files. Only use on files that can be restored via git or other version control.\n\n**Note**: This is a personal default. If a `.herb.yml` file exists in your project, its configuration takes precedence." }, "languageServerHerb.formatter.indentWidth": { "scope": "resource", "type": "number", "default": 2, "description": "Number of spaces for each indentation level.", "markdownDescription": "Number of spaces for each indentation level.\n\n**Note**: This is a personal default. If a `.herb.yml` file exists in your project, its configuration takes precedence." }, "languageServerHerb.formatter.indentStyle": { "scope": "resource", "type": "string", "enum": [ "space", "tab" ], "default": "space", "description": "Character used for indentation.", "markdownDescription": "Character used for indentation.\n\n**Note**: This is a personal default. If a `.herb.yml` file exists in your project, its configuration takes precedence." }, "languageServerHerb.formatter.maxLineLength": { "scope": "resource", "type": "number", "default": 80, "description": "Maximum line length before wrapping.", "markdownDescription": "Maximum line length before wrapping.\n\n**Note**: This is a personal default. If a `.herb.yml` file exists in your project, its configuration takes precedence." }, "languageServerHerb.inlayHints.enabled": { "scope": "resource", "type": "boolean", "default": true, "description": "Annotate the closing tag of longer blocks with what it closes. An ERB end tag shows the expression that opened the block, and an HTML closing tag shows the element's id or class.", "markdownDescription": "Annotate the closing tag of longer blocks with what it closes. An ERB `<% end %>` shows the expression that opened the block, like `# if user.admin?`, and an HTML closing tag shows the element's `id` or `class`, like ``.\n\n**Note**: VS Code's own `editor.inlayHints.enabled` still applies on top of this, and turning it off hides hints from every extension." }, "languageServerHerb.inlayHints.minimumLines": { "scope": "resource", "type": "number", "minimum": 1, "default": 10, "description": "How many lines below its opening tag a closing tag has to be before it gets a hint. The default of 2 leaves blocks that fit within two lines unannotated.", "markdownDescription": "How many lines below its opening tag a closing tag has to be before it gets a hint. The default of `2` leaves blocks that fit within two lines unannotated, since you can still see what they opened." }, "languageServerHerb.inlayHints.maximumClasses": { "scope": "resource", "type": "number", "minimum": 0, "default": 2, "description": "How many of an element's classes to include in its hint. Past a couple the list is the element's styling rather than its name, so the rest are left off. Set to 0 to name elements by id alone.", "markdownDescription": "How many of an element's classes to include in its hint. Past a couple the list is the element's styling rather than its name, so the rest are left off, which keeps utility-class markup readable. Set to `0` to name elements by `id` alone." }, "languageServerHerb.trace.server": { "scope": "window", "type": "string", "enum": [ "off", "messages", "verbose" ], "default": "verbose", "description": "Traces the communication between Visual Studio Code and the Herb language server (for debugging)." }, "languageServerHerb.workspace.suggestAddingProjects": { "scope": "window", "type": "boolean", "default": true, "description": "Suggest adding a file's project folder to the workspace when an HTML+ERB file outside the current workspace folders is opened. Herb only analyzes files inside workspace folders.", "markdownDescription": "Suggest adding a file's project folder to the workspace when an HTML+ERB file outside the current workspace folders is opened. Herb only analyzes files inside workspace folders." }, "languageServerHerb.runtimeReports.inlayHints": { "scope": "resource", "type": "boolean", "default": true, "description": "Annotate ERB tags with what the application recorded against them while it rendered, like how many queries a render call ran. Nothing appears until the application writes a journal, and a tag stops being annotated once you edit the template.", "markdownDescription": "Annotate ERB tags with what the application recorded against them while it rendered, like `(2 SQL queries)` beside a `render` call. Nothing appears until the application writes a journal, and a tag stops being annotated once you edit the template, since what was recorded no longer describes what is written there." }, "languageServerHerb.runtimeOverlays.display": { "type": "string", "enum": [ "replace", "report", "off" ], "enumDescriptions": [ "Show what the tag rendered in place of the tag. The tag is revealed on whichever line the cursor is on, so it stays editable.", "Leave the tag as written and underline it, with what it rendered in the hover.", "Show nothing." ], "default": "replace", "description": "How to show what an ERB tag rendered, for tags the application asked Herb to capture." } } }, "commands": [ { "command": "herb.analyzeProject", "title": "Herb: Analyze Project", "icon": "$(refresh)" }, { "command": "herb.reprocessFile", "title": "Herb: Re-analyze File", "icon": "$(refresh)" }, { "command": "herb.createConfig", "title": "Herb: Create Herb Configuration", "icon": "$(file-add)" }, { "command": "herb.editConfig", "title": "Herb: Edit Herb Configuration", "icon": "$(edit)" }, { "command": "herb.reportIssue", "title": "Herb: Report Issue", "icon": "$(github)" }, { "command": "herb.reportDetailedIssue", "title": "Herb: Report Detailed Issue", "icon": "$(github)" }, { "command": "herb.reportGeneralIssue", "title": "Herb: Report General Issue", "icon": "$(github)" }, { "command": "herb.reportDiagnosticIssue", "title": "Herb: Report Issue with Diagnostic", "icon": "$(github)", "when": "false" }, { "command": "herb.toggleLineComment", "title": "Herb: Toggle Line Comment", "when": "editorLangId == erb" }, { "command": "herb.toggleBlockComment", "title": "Herb: Toggle Block Comment", "when": "editorLangId == erb" }, { "command": "herb.extractToPartial", "title": "Herb: Extract to Partial", "when": "editorLangId == erb" }, { "command": "herb.toggleLinter", "title": "Herb: Toggle Linter", "icon": "$(symbol-boolean)" }, { "command": "herb.toggleFormatter", "title": "Herb: Toggle Formatter", "icon": "$(symbol-boolean)" }, { "command": "herb.setIndentWidth", "title": "Herb: Set Indent Width", "icon": "$(symbol-numeric)" }, { "command": "herb.setIndentStyle", "title": "Herb: Set Indent Style", "icon": "$(symbol-enum)" }, { "command": "herb.setMaxLineLength", "title": "Herb: Set Max Line Length", "icon": "$(symbol-numeric)" }, { "command": "herb.changeRuntimeOverlayDisplay", "title": "Change Runtime Value Display", "category": "Herb" } ], "keybindings": [ { "command": "herb.toggleLineComment", "key": "ctrl+/", "mac": "cmd+/", "when": "editorTextFocus && editorLangId == erb" }, { "command": "herb.toggleBlockComment", "key": "shift+alt+a", "mac": "shift+alt+a", "when": "editorTextFocus && editorLangId == erb" } ], "viewsContainers": { "activitybar": [ { "id": "herbExplorer", "title": "Herb", "icon": "assets/herb.svg" } ] }, "views": { "herbExplorer": [ { "id": "herbFileStatus", "name": "Project Analysis", "visibility": "visible" }, { "id": "herbConfiguration", "name": "Configuration", "visibility": "visible" }, { "id": "herbInformation", "name": "Information", "visibility": "collapsed" }, { "id": "herbSupport", "name": "Support", "visibility": "collapsed" } ] }, "menus": { "view/title": [ { "command": "herb.analyzeProject", "when": "view == herbFileStatus", "group": "navigation" }, { "command": "herb.createConfig", "when": "view == herbConfiguration && !herb.hasProjectConfig", "group": "navigation" }, { "command": "herb.editConfig", "when": "view == herbConfiguration && herb.hasProjectConfig", "group": "navigation" } ], "view/item/context": [ { "command": "herb.toggleLinter", "when": "view == herbConfiguration && (viewItem == linterSetting || viewItem == personalLinterSetting)", "group": "inline" }, { "command": "herb.toggleFormatter", "when": "view == herbConfiguration && (viewItem == formatterSetting || viewItem == personalFormatterSetting)", "group": "inline" }, { "command": "herb.reprocessFile", "when": "view == herbFileStatus && (viewItem == herbFileWithIssues || viewItem == herbFileOk)", "group": "inline" }, { "command": "herb.reportDetailedIssue", "when": "view == herbFileStatus && viewItem == herbFileWithIssues", "group": "inline" } ] }, "viewsWelcome": [ { "view": "herbFileStatus", "contents": "Run a project analysis to get started", "button": { "title": "Analyze Project", "command": "herb.analyzeProject" } }, { "view": "herbConfiguration", "contents": "Create a Herb configuration file to share Herb settings with your team.\n\n[Create .herb.yml](command:herb.createConfig)", "when": "!herb.hasProjectConfig" } ] }, "scripts": { "vscode:prepublish": "yarn run package", "build": "yarn clean && yarn sync-defaults && yarn run typecheck && yarn build:language-server && node esbuild.js", "build:language-server": "cd ../language-server && yarn build && cd -", "watch": "npm-run-all -p watch:*", "watch:esbuild": "node esbuild.js --watch", "watch:tsc": "tsc --noEmit --watch --project tsconfig.json", "package": "yarn run typecheck && node esbuild.js --production", "build-tests": "tsc -p . --outDir out", "watch-tests": "tsc -p . -w --outDir out", "pretest": "yarn run build-tests && yarn run build", "typecheck": "tsc --noEmit", "test": "if [ -z \"$DISPLAY\" ]; then xvfb-run -a yarn vscode:test; else yarn vscode:test; fi", "vscode:test": "vscode-test", "clean": "rimraf dist", "sync-defaults": "node scripts/sync-defaults.js", "prepublishOnly": "yarn clean && yarn build && yarn test" }, "devDependencies": { "@herb-tools/config": "0.11.2", "@herb-tools/formatter": "0.11.2", "@herb-tools/language-server": "0.11.2", "@herb-tools/language-service": "0.11.2", "@herb-tools/linter": "0.11.2", "@herb-tools/node-wasm": "0.11.2", "@types/mocha": "^10.0.10", "@types/node": "26.x", "@types/vscode": "^1.100.0", "@vscode/test-cli": "^0.0.15", "@vscode/test-electron": "^3.1.0", "esbuild": "^0.28.2", "npm-run-all": "^4.1.5", "vscode-languageclient": "^11.0.0" } }