Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Vim Neovim

Charles-Philippe Clermont edited this page Jan 22, 2021 · 7 revisions

Theme-Check is implemented as an LSP server. This means that it integrates pretty well with any editor that has an LSP Client.

If installed via homebrew, the path to the language server should be on your $PATH as theme-check-liquid-server

dense-analysis/ale Configuration

" in vimrc (or config/nvim/init.vim) somewhere
let g:ale_linters = {}
let g:ale_linters.liquid = ['theme-check-language-server']

function! ThemeCheckGetProjectRoot(buffer) abort
  let l:project_root = ale#path#FindNearestFile(a:buffer, '.theme-check.yml')
  return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
endfunction

call ale#linter#Define('liquid', {
\   'name': 'theme-check-language-server',
\   'lsp': 'stdio',
\   'executable': system('which theme-check-language-server | tr -d "\n" '),
\   'project_root': function('ThemeCheckGetProjectRoot'),
\   'command': '%e',
\})
Clone this wiki locally