slim-template / slim

Slim is a template language whose goal is to reduce the syntax to the essential parts without becoming cryptic.
https://slim-template.github.io
MIT License
5.31k stars 501 forks source link

Sorbet support #896

Open Nitrodist opened 2 years ago

Nitrodist commented 2 years ago

Is there a way we can get sorbet support? I use vim + coc + srb command to typecheck my .rb files. I turned it on for .slim files as well and... well it threw me errors and then promptly refused to elaborate :)

Here's my CocOpenLog output:

2022-11-25T22:40:16.660 WARN (pid:7726) [handler-format] - Format provider not found for file:///Users/markcampbell/o/BusyPaws.app/app/views/business/admin/custom_report_fields/_form.html.slim

I don't necessarily expect you @minad to fix this, and I really appreciate your work (enjoy the $100 USD I donated) - perhaps there are some other interested parties out there that also want this kind of a feature implemented? I looked into it for a few minutes and I think I'm just going to go back to work for now haha. This feature sure would be nice though!

My lsp config in coc-settings.json if needed:

  "languageserver": {
    "sorbet": {
      "command": "srb",
      "args": [
        "tc",
        "--typed",
        "true",
        "--enable-all-experimental-lsp-features",
        "--lsp"
      ],
      "filetypes": ["ruby", "slim"],
      "rootPatterns": ["sorbet/config"],
      "initializationOptions": {},
      "settings": {}
    }
  }

Thanks!

minad commented 2 years ago

Thanks! Sorbet is interesting. I may actually try this out. However I am an Emacs user. :)

Nitrodist commented 2 years ago

Fear not, LSP support exists in emacs! https://emacs-lsp.github.io/lsp-mode/

Nitrodist commented 1 year ago

rufo exists as well. they make a great pair!

https://github.com/ruby-formatter/rufo