0.0
No release in over 3 years
A Ruby LSP addon that provides language server features for Slim template files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.26.0, < 1.0
>= 4.0, < 6.0
 Project Readme

Ruby LSP Slim

A Ruby LSP addon that provides language server features for Slim template files.

Features

  • Hover — see method signatures and documentation
  • Go-to-definition — jump to method/class definitions from Slim templates
  • Completion — autocomplete Ruby methods and variables
  • Document symbols — outline view for Ruby code in templates
  • Diagnostics — syntax errors and warnings
  • Semantic highlighting — rich syntax coloring for embedded Ruby

Installation

1. Add the gem

Add ruby-lsp-slim to your project's Gemfile:

group :development do
  gem "ruby-lsp-slim"
end

Then run bundle install.

2. Install the VS Code extension

Install the Ruby LSP Slim extension from the VS Code marketplace, or search for "Ruby LSP Slim" in the Extensions panel.

The extension runs a dedicated Ruby LSP server for .slim files, so all standard Ruby LSP features work inside your templates.

3. Restart VS Code

After installing both the gem and extension, reload your VS Code window (Cmd+Shift+P → "Developer: Reload Window").

Supported Slim syntax

Pattern Example
Control code - x = 1
Output = link_to "Home", root_path
Unescaped output == raw_html
Tag output h1= title
Interpolation p Hello #{user.name}
Ruby filter ruby: block
Comments / comment
Text blocks | text content
Backslash continuation - x = 1 + \ (continues next line)

Requirements

  • Ruby >= 3.0.0
  • ruby-lsp >= 0.26.0, < 1.0
  • slim >= 4.0

Development

bundle install
bundle exec rake test

License

MIT