editors/helix/manual.md
Currently, rome supports the following file extensions: js, jsx, ts, tsx and d.ts.
Rome has a an lsp-proxy command that acts as a server for the Language Server Protocol over stdin/stdout.
languages.toml
[[language]]
name = "javascript"
scope = "source.js"
file-types = ["js"]
language-server = { command = "rome", args = ["lsp-proxy"] }
formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.js"]}
auto-format = true
[[language]]
name = "jsx"
scope = "source.jsx"
file-types = ["jsx"]
language-server = { command = "rome", args = ["lsp-proxy"] }
formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.jsx"]}
auto-format = true
[[language]]
name = "typescript"
scope = "source.ts"
file-types = ["ts"]
language-server = { command = "rome", args = ["lsp-proxy"] }
formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.ts"]}
auto-format = true
[[language]]
name = "tsx"
scope = "source.tsx"
file-types = ["tsx"]
language-server = { command = "rome", args = ["lsp-proxy"] }
formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.tsx"]}
auto-format = true
The version of Helix after 23.05 will have support for multiple language servers and the language server configuration has changed a bit.
Now you can use rome alongside typescript-language-server.
[language-server]
rome = { command = "rome", args = ["lsp-proxy"] }
[[language]]
name = "javascript"
auto-format = true
comment-token = "//"
file-types = ["js", "mjs", "cjs"]
injection-regex = "(js|javascript)"
language-id = "javascript"
language-servers = ["typescript-language-server", "rome"]
roots = []
scope = "source.js"
shebangs = ["node"]
[language.formatter]
command = "rome"
args = ["format", "--stdin-file-path", "test.js"]
[language.indent]
tab-width = 2
unit = " "
[[language]]
name = "typescript"
auto-format = true
file-types = ["ts", "mts", "cts"]
injection-regex = "(ts|typescript)"
language-id = "typescript"
language-servers = ["typescript-language-server", "rome"]
roots = []
scope = "source.ts"
shebangs = []
[language.formatter]
command = "rome"
args = ["format", "--stdin-file-path", "test.ts"]
[language.indent]
tab-width = 2
unit = " "
[[language]]
name = "tsx"
auto-format = true
file-types = ["tsx"]
injection-regex = "(tsx)"
language-id = "typescriptreact"
language-servers = ["typescript-language-server", "rome"]
roots = []
scope = "source.tsx"
[language.formatter]
command = "rome"
args = ["format", "--stdin-file-path", "test.tsx"]
[language.indent]
tab-width = 2
unit = " "
[[language]]
name = "jsx"
auto-format = true
comment-token = "//"
file-types = ["jsx"]
grammar = "javascript"
injection-regex = "jsx"
language-id = "javascriptreact"
language-servers = ["typescript-language-server", "rome"]
roots = []
scope = "source.jsx"
[language.formatter]
command = "rome"
args = ["format", "--stdin-file-path", "test.jsx"]
[language.indent]
tab-width = 2
unit = " "
[[language]]
name = "json"
auto-format = true
file-types = ["json", "jsonc", "arb", "ipynb", "geojson"]
injection-regex = "json"
language-servers = ["rome"]
roots = []
scope = "source.json"
[language.formatter]
command = "rome"
args = ["format", "--stdin-file-path", "test.json"]