windicss-intellisense icon indicating copy to clipboard operation
windicss-intellisense copied to clipboard

Does this work with Vim as an LSP?

Open benwoodward opened this issue 4 years ago • 5 comments

Basically, I want to be able to do this:

  windicss = {
    cmd = { "windicss-language-server", "--stdio" },
    filetypes = { "aspnetcorerazor", "astro", "astro-markdown", "blade", "django-html", "edge", "eelixir", "ejs", "erb", "eruby", "gohtml", "haml", "handlebars", "hbs", "html", "html-eex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte" },
    init_options = {
      userLanguages = {
        eelixir = "html-eex",
        eruby = "erb"
      },
    },
    on_new_config = function(new_config)
      if not new_config.settings then
        new_config.settings = {}
      end
      if not new_config.settings.editor then
        new_config.settings.editor = {}
      end
      if not new_config.settings.editor.tabSize then
        -- set tab size for hover
        new_config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop()
      end
    end,
    root_dir = util.root_pattern('windi.config.js', 'windi.config.cjs', 'windi.config.ts', 'tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts', 'package.json', 'node_modules', '.git'),
    settings = {
      tailwindCSS = {
        lint = {
          cssConflict = "warning",
          invalidApply = "error",
          invalidConfigPath = "error",
          invalidScreen = "error",
          invalidTailwindDirective = "error",
          invalidVariant = "error",
          recommendedVariantOrder = "warning"
        },
        validate = true
      },
    },
  },
require'lspconfig'.windicss.setup{}

...and then for it to work with Neovim via https://github.com/neovim/nvim-lspconfig

benwoodward avatar Sep 03 '21 20:09 benwoodward

I would also love to see this in neovim, as the tailwindcss language server doesn't seem to work with this. 👍🏼

theoparis avatar Oct 26 '21 02:10 theoparis

I would also welcome a windi lsp support in neovim!

dedani avatar Nov 18 '21 17:11 dedani

updates?

Suya1671 avatar Apr 23 '22 17:04 Suya1671

Any news? It would be awesome to use this in my projects.

olgam4 avatar Jun 12 '22 14:06 olgam4

You would need to split the backend part from the extension and then make the extension call the backend while allowing the backend to run as its own thing

Suya1671 avatar Jun 12 '22 16:06 Suya1671