[
["ruby", "ruby", %w[.rb .rake .gemspec Gemfile Rakefile], "#", /(?:^\s*(?:class|module|def|if|unless|case|while|until|for|begin)\b.*|(?:\bdo|[\[{(])(?:\s*\|[^|]*\|)?\s*)$/, /^\s*(?:end\b|else\b|elsif\b|rescue\b|ensure\b|[\]})])/, [["ruby-lsp"]]],
["javascript", "javascript", %w[.js .jsx .mjs .cjs], "//", /[\[{(]\s*$/, /^\s*[\]})]/, [["typescript-language-server", "--stdio"]]],
["typescript", "typescript", %w[.ts .tsx], "//", /[\[{(]\s*$/, /^\s*[\]})]/, [["typescript-language-server", "--stdio"]]],
["python", "python", %w[.py .pyi], "#", /:\s*(?:#.*)?$/, /^\s*(?:else|elif|except|finally)\b/, [["pyright-langserver", "--stdio"]]],
["rust", "rust", %w[.rs], "//", /[\[{(]\s*$/, /^\s*[\]})]/, [["rust-analyzer"]]],
["go", "go", %w[.go], "//", /[\[{(]\s*$/, /^\s*[\]})]/, [["gopls"]]],
["c", "c", %w[.c .h], "//", /[\[{(]\s*$/, /^\s*[\]})]/, [["clangd"]]],
["cpp", "cpp", %w[.cpp .hpp .cc .cxx], "//", /[\[{(]\s*$/, /^\s*[\]})]/, [["clangd"]]],
["json", "json", %w[.json .jsonc], "//", /[\[{]\s*$/, /^\s*[\]}]/, []],
["yaml", "yaml", %w[.yml .yaml], "#", /:\s*$/, /^\s*$/, []],
["toml", "toml", %w[.toml], "#", /[\[{]\s*$/, /^\s*[\]}]/, []],
["markdown", "markdown", %w[.md .markdown], "<!--", /\A\z/, /\A\z/, []],
["html", "html", %w[.html .erb], "<!--", /<[^\/>]+>\s*$/, /^\s*<\//, []],
["xml", "xml", %w[.xml .xhtml .svg], "<!--", /<[^\/>]+>\s*$/, /^\s*<\//, []],
["css", "css", %w[.css .scss], "/*", /\{\s*$/, /^\s*}/, []],
["shellscript", "shell", %w[.sh .bash .zsh], "#", /\b(?:then|do|case)\s*$/, /^\s*(?:fi|done|esac)\b/, []]
].map { |values| Definition.new(*values) }.freeze