New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

css-variable-ls

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-variable-ls

CSS Variables Language Server in node.

latest
Source
npmnpm
Version
0.6.38
Version published
Maintainers
1
Created
Source

CSS Variable Langauage Server

I did no actual work on this language server. I just extracted the language server Vu Nguyen created for CSS Variables Autocomplete and adapted it for my use case. All credit goes to Vu Nguyen.

Installation

npm i -g css-variable-ls

Setup

    if not configs.cssvar then
        configs.cssvar = {
            default_config = {
                cmd = { "cssvar", "--stdio" },
                filetypes = { "css", "scss", "less" },
                root_dir = lsp.util.root_pattern("package.json", ".git"),
                single_file_support = true,
                settings = {
                    cssVariables = {
                        lookupFiles = {
                            "**/*.css",
                            "**/*.scss",
                            "**/*.sass",
                            "**/*.less",
                        },
                    },
                },
            },
            docs = {
                default_config = {
                    root_dir = [[root_pattern("", ".git") or bufdir]],
                },
            },
        }
    end
    lsp.cssvar.setup({
    ...
        on_new_config = function(_, root_dir)
            local client = vim.lsp.get_active_clients({ name = "cssvar" })[1]
            local path = util.path.join(root_dir, ".luarc.json")
            if util.path.exists(path) == false then
                return
            end
            local f = assert(io.open(path, "r")) -- assuming path is in the scope
            local content = f:read("*a")
            f:close()
            local config = vim.json.decode(content)
            if config == nil or config["cssVariables"] == nil then
                return
            end
            if client == nil then
                return
            end
            client.notify(
                "workspace/didChangeConfiguration",
                { settings = {
                    cssVariables = config["cssVariables"],
                } }
            )
        end,
        ...
    })

FAQs

Package last updated on 30 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts