Skip to content

rhombus support #13

@jyn514

Description

@jyn514

(rhombus is https://github.com/racket/rhombus/; lang docs at https://docs.racket-lang.org/rhombus/index.html)

@benknoble had the following suggestions on discord:

  • create a new ftplugin/rhombus.vim that tweaks :setlocal commentstring and b:undo_ftplugin. vim also suggests setting b:undo_indent; see :h ftplugin.
  • add .rhm to
    au BufRead,BufNewFile *.rkt,*.rktl,*.zuo call RacketDetectHashLang()
  • document how to set up an LSP for Rhombus. i see ALE support for racket in
    let b:ale_linter_aliases = ['racket']
    and
    let b:ale_linter_aliases = ['racket']
    for neovim + lspconfig i have this configuration for myself; maybe it will help someone:
local lsplang = require('lspconfig.configs')
if not lsplang.rhombus then
	lsplang.rhombus = {
		default_config = {
			cmd = {"racket",  "-l", "racket-langserver"},
			filetypes = { "rhombus" },
			root_dir = vim.fs.dirname,
			settings = {},
		},
	}
end
lspconfig.rhombus.setup {}

Note that there are some limitations to this setup.

  • syntax highlighting is only enabled through the LSP, and the LSP has some bugs (in particular it doesn't do SematicTokens for keywords). that should probably be an upstream bug.
  • autoindentation isn't automatic. we could fix that with some manual work in rhombus.vim. i think the recommended way is indent-expression?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions