xna00 / unocss-language-server

MIT License
53 stars 8 forks source link

textDocument/documentColor support #12

Closed siduck closed 1 month ago

siduck commented 1 month ago

hi @xna00 , glad that this project's alive! if I'm not mistaken, you have made this LSP right? or this is a wrapper of unocss vscode extension or something like that :thinking:

tailwind/css lsps support colorProvider, so through which we can color the classes / variables , like bg-blue-5 etc

but unocss doesnt seem to support it

xna00 commented 1 month ago

Supported in v0.1.2

siduck commented 1 month ago

is it disabled by default? document-colors.nvim didnt work for me, i have my own colorizier

  local param = { textDocument = vim.lsp.util.make_text_document_params() }

  for _, client in pairs(vim.lsp.get_clients { bufnr = buf }) do
    if client.server_capabilities.colorProvider then
      client.request("textDocument/documentColor", param, function(_, resp)
        vim.print(resp) 

and the response is always nil

xna00 commented 1 month ago

No, it's enbaled.

I tested with the following config.

  use { 'mrshmllow/document-color.nvim', config = function()
    require("document-color").setup {
      -- Default options
      mode = "background", -- "background" | "foreground" | "single"
    }
  end
  }

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.colorProvider = {
  dynamicRegistration = true
}

local on_attach = function(client, bufnr)
  if client.server_capabilities.colorProvider then
    -- Attach document colour support
    require("document-color").buf_attach(bufnr)
  end

and

set termguicolor
xna00 commented 1 month ago

Please check your LspLog to see if these logs exist.

[DEBUG][2024-06-20 09:16:58] .../vim/lsp/rpc.lua:388    "rpc.receive"   {  id = 2,  jsonrpc = "2.0",  result = { {      color = {        alpha = 1,        blue = 0.44313725490196,        green = 0.44313725490196,        red = 0.97254901960784      },      range = {        ["end"] = {          character = 18,          line = 0        },        start = {          character = 12,          line = 0        }      }    }, {      color = {        alpha = 1,        blue = 0.98039215686275,        green = 0.64705882352941,        red = 0.37647058823529      },      range = {        ["end"] = {          character = 28,          line = 0        },        start = {          character = 19,          line = 0        }      }    } }}

And are you using the latest version(v0.1.3)?

siduck commented 1 month ago

image

can you an image of colors being highlighted?

siduck commented 1 month ago

document-colors works with tailwind lsp

image

And my lsplog is empty

siduck commented 1 month ago

I'll try to reproduce with minimal init.lua

xna00 commented 1 month ago

This is my tested file. image

siduck commented 1 month ago

hmm didnt work in minimal init.lua too. new logs https://paste.sh/cL3t23Wz#ZunE4-jlZn7-9STBCVuHs7dz and minimal init.lua

vim.cmd.colorscheme("habamax")

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable",
        lazypath,
    })
end

vim.opt.rtp:prepend(lazypath)

local capabilities = vim.lsp.protocol.make_client_capabilities()

capabilities.textDocument.colorProvider = {
    dynamicRegistration = true,
}

local on_attach = function(client, bufnr)
    if client.server_capabilities.colorProvider then
        -- Attach document colour support
        require("document-color").buf_attach(bufnr)
    end
end

local plugins = {
    {
        "williamboman/mason.nvim",
        build = ":MasonUpdate",
        config = function()
            require("mason").setup()
        end,
    },

    {
        "neovim/nvim-lspconfig",
        config = function()
            require("lspconfig").unocss.setup({
                on_attach = on_attach,
                capabilities = capabilities,
            })
        end,
    },

    {
        "mrshmllow/document-color.nvim",
        config = function()
            require("document-color").setup({
                mode = "background",
            })
        end,
    },
}

require("lazy").setup(plugins)

image

image

siduck commented 1 month ago

do i need new unocss version?

image

xna00 commented 1 month ago

new logs https://paste.sh/cL3t23Wz#ZunE4-jlZn7-9STBCVuHs7dz

It is an empty page?

siduck commented 1 month ago

lsp.log

oh boi the logs are huge, like 6k ~

cleared logs and tried again

image

xna00 commented 1 month ago

I tested your minimal init.lua and it works. Try running :set termguicolors. image

xna00 commented 1 month ago

cleared logs and tried again

image

Add vim.lsp.set_log_level("debug") to your init.lua file.

siduck commented 1 month ago
[START][2024-06-20 08:46:30] LSP logging initiated
[INFO][2024-06-20 08:46:30] .../lua/vim/lsp.lua:793 "exit_handler"  {}
[START][2024-06-20 08:46:43] LSP logging initiated
[INFO][2024-06-20 08:46:43] .../vim/lsp/rpc.lua:731 "Starting RPC client"   {  cmd = { "unocss-language-server", "--stdio" },  extra = {    cwd = "/home/siduck/ors"  }}
[DEBUG][2024-06-20 08:46:43] .../vim/lsp/rpc.lua:286    "rpc.send"  {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      general = {        positionEncodings = { "utf-16" }      },      textDocument = {        callHierarchy = {          dynamicRegistration = false        },        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = true,          isPreferredSupport = true,          resolveSupport = {            properties = { "edit" }          }        },        colorProvider = {          dynamicRegistration = true        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },            preselectSupport = false,            snippetSupport = false          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          completionList = {            itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          dynamicRegistration = true,          linkSupport = true        },        diagnostic = {          dynamicRegistration = false        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        formatting = {          dynamicRegistration = true        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = true        },        implementation = {          linkSupport = true        },        inlayHint = {          dynamicRegistration = true,          resolveSupport = {            properties = { "textEdits", "tooltip", "location", "command" }          }        },        publishDiagnostics = {          dataSupport = true,          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        rangeFormatting = {          dynamicRegistration = true        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = true,          prepareSupport = true        },        semanticTokens = {          augmentsSyntaxTokens = true,          dynamicRegistration = false,          formats = { "relative" },          multilineTokenSupport = false,          overlappingTokenSupport = true,          requests = {            full = {              delta = true            },            range = false          },          serverCancelSupport = false,          tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" },          tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = true,          willSaveWaitUntil = true        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = true        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        didChangeConfiguration = {          dynamicRegistration = false        },        didChangeWatchedFiles = {          dynamicRegistration = false,          relativePatternSupport = true        },        inlayHint = {          refreshSupport = true        },        semanticTokens = {          refreshSupport = true        },        symbol = {          dynamicRegistration = false,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.10.0-dev"    },    initializationOptions = vim.empty_dict(),    processId = 17510,    rootPath = "/home/siduck/ors",    rootUri = "file:///home/siduck/ors",    trace = "off",    workDoneToken = "1",    workspaceFolders = { {        name = "/home/siduck/ors",        uri = "file:///home/siduck/ors"      } }  }}
[DEBUG][2024-06-20 08:46:43] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  jsonrpc = "2.0",  method = "window/logMessage",  params = {    message = "unocss: before add onCompletion listener",    type = 4  }}
[INFO][2024-06-20 08:46:43] ...lsp/handlers.lua:627 "unocss: before add onCompletion listener"
[DEBUG][2024-06-20 08:46:43] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  jsonrpc = "2.0",  method = "window/logMessage",  params = {    message = "unocss: after add listener",    type = 4  }}
[INFO][2024-06-20 08:46:43] ...lsp/handlers.lua:627 "unocss: after add listener"
[DEBUG][2024-06-20 08:46:43] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  id = 1,  jsonrpc = "2.0",  result = {    capabilities = {      colorProvider = true,      completionProvider = {        resolveProvider = true      },      documentHighlightProvider = false,      hoverProvider = true,      textDocumentSync = 2,      workspace = {        workspaceFolders = {          supported = true        }      }    }  }}
[DEBUG][2024-06-20 08:46:43] .../vim/lsp/rpc.lua:286    "rpc.send"  {  jsonrpc = "2.0",  method = "initialized",  params = vim.empty_dict()}
[DEBUG][2024-06-20 08:46:43] .../vim/lsp/rpc.lua:286    "rpc.send"  {  jsonrpc = "2.0",  method = "textDocument/didOpen",  params = {    textDocument = {      languageId = "html",      text = "\n<div class='bg-red-100 text-blue'></div>\n",      uri = "file:///home/siduck/ors/src/a.html",      version = 0    }  }}
[DEBUG][2024-06-20 08:46:44] ...m/lsp/client.lua:676    "LSP[unocss]"   "client.request"    1   "textDocument/documentColor"    {  textDocument = {    uri = "file:///home/siduck/ors/src/a.html"  }}   <function 1>    1
[DEBUG][2024-06-20 08:46:44] .../vim/lsp/rpc.lua:286    "rpc.send"  {  id = 2,  jsonrpc = "2.0",  method = "textDocument/documentColor",  params = {    textDocument = {      uri = "file:///home/siduck/ors/src/a.html"    }  }}
[INFO][2024-06-20 08:46:44] ...m/lsp/client.lua:618 "LSP[unocss]"   "server_capabilities"   {  server_capabilities = {    colorProvider = true,    completionProvider = {      resolveProvider = true    },    documentHighlightProvider = false,    hoverProvider = true,    textDocumentSync = {      change = 2,      openClose = true,      save = {        includeText = false      },      willSave = false,      willSaveWaitUntil = false    },    workspace = {      workspaceFolders = {        supported = true      }    }  }}
[DEBUG][2024-06-20 08:46:44] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  error = {    code = -32603,    message = "Request textDocument/documentColor failed with message: Cannot read properties of undefined (reading 'trim')"  },  id = 2,  jsonrpc = "2.0"}
[INFO][2024-06-20 08:47:00] .../lua/vim/lsp.lua:793 "exit_handler"  { {    _log_prefix = "LSP[unocss]",    _on_attach_cbs = { <function 1> },    _on_exit_cbs = { <function 2>, <function 3> },    _on_init_cbs = { <function 4> },    _root_dir = "/home/siduck/ors",    _trace = "off",    attached_buffers = { true },    cancel_request = <function 5>,    capabilities = <1>{      general = {        positionEncodings = { "utf-16" }      },      textDocument = {        callHierarchy = {          dynamicRegistration = false        },        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = true,          isPreferredSupport = true,          resolveSupport = {            properties = { "edit" }          }        },        colorProvider = {          dynamicRegistration = true        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },            preselectSupport = false,            snippetSupport = false          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          completionList = {            itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          dynamicRegistration = true,          linkSupport = true        },        diagnostic = {          dynamicRegistration = false        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        formatting = {          dynamicRegistration = true        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = true        },        implementation = {          linkSupport = true        },        inlayHint = {          dynamicRegistration = true,          resolveSupport = {            properties = { "textEdits", "tooltip", "location", "command" }          }        },        publishDiagnostics = {          dataSupport = true,          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        rangeFormatting = {          dynamicRegistration = true        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = true,          prepareSupport = true        },        semanticTokens = {          augmentsSyntaxTokens = true,          dynamicRegistration = false,          formats = { "relative" },          multilineTokenSupport = false,          overlappingTokenSupport = true,          requests = {            full = {              delta = true            },            range = false          },          serverCancelSupport = false,          tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" },          tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = true,          willSaveWaitUntil = true        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = true        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        didChangeConfiguration = {          dynamicRegistration = false        },        didChangeWatchedFiles = {          dynamicRegistration = false,          relativePatternSupport = true        },        inlayHint = {          refreshSupport = true        },        semanticTokens = {          refreshSupport = true        },        symbol = {          dynamicRegistration = false,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    commands = {},    config = {      _on_attach = <function 6>,      autostart = true,      capabilities = <table 1>,      cmd = { "unocss-language-server", "--stdio" },      cmd_cwd = "/home/siduck/ors",      filetypes = { "html", "javascriptreact", "rescript", "typescriptreact", "vue", "svelte" },      handlers = <2>{},      init_options = vim.empty_dict(),      log_level = 2,      message_level = 2,      name = "unocss",      on_attach = <function 1>,      on_exit = <function 2>,      on_init = <function 4>,      root_dir = "/home/siduck/ors",      settings = <3>vim.empty_dict(),      workspace_folders = <4>{ {          name = "/home/siduck/ors",          uri = "file:///home/siduck/ors"        } },      <metatable> = <5>{        __tostring = <function 7>      }    },    dynamic_capabilities = {      capabilities = {},      client_id = 1,      <metatable> = {        __index = {          get = <function 8>,          match = <function 9>,          new = <function 10>,          register = <function 11>,          supports = <function 12>,          supports_registration = <function 13>,          unregister = <function 14>        }      }    },    flags = {},    get_language_id = <function 15>,    handlers = <table 2>,    id = 1,    initialized = true,    is_stopped = <function 16>,    messages = {      messages = {},      name = "unocss",      progress = {},      status = {}    },    name = "unocss",    notify = <function 17>,    offset_encoding = "utf-16",    on_attach = <function 18>,    progress = {      _idx_read = 0,      _idx_write = 0,      _items = {},      _size = 51,      pending = {},      <metatable> = {        __call = <function 19>,        __index = {          clear = <function 20>,          peek = <function 21>,          pop = <function 22>,          push = <function 23>        }      }    },    request = <function 24>,    request_sync = <function 25>,    requests = {},    root_dir = "/home/siduck/ors",    rpc = {      is_closing = <function 26>,      notify = <function 27>,      request = <function 28>,      terminate = <function 29>    },    server_capabilities = {      colorProvider = true,      completionProvider = {        resolveProvider = true      },      documentHighlightProvider = false,      hoverProvider = true,      textDocumentSync = {        change = 2,        openClose = true,        save = {          includeText = false        },        willSave = false,        willSaveWaitUntil = false      },      workspace = {        workspaceFolders = {          supported = true        }      }    },    settings = <table 3>,    stop = <function 30>,    supports_method = <function 31>,    workspace_did_change_configuration = <function 32>,    workspace_folders = <table 4>,    <metatable> = <6>{      __index = <table 6>,      _add_workspace_folder = <function 33>,      _cancel_request = <function 34>,      _exec_cmd = <function 35>,      _is_stopped = <function 36>,      _notification = <function 37>,      _notify = <function 38>,      _on_attach = <function 39>,      _on_error = <function 40>,      _on_exit = <function 41>,      _remove_workspace_folder = <function 42>,      _request = <function 43>,      _request_sync = <function 44>,      _resolve_handler = <function 45>,      _run_callbacks = <function 46>,      _server_request = <function 47>,      _stop = <function 48>,      _supports_method = <function 49>,      _text_document_did_open_handler = <function 50>,      create = <function 51>,      initialize = <function 52>,      write_error = <function 53>    }  } }
[DEBUG][2024-06-20 08:47:00] .../vim/lsp/rpc.lua:286    "rpc.send"  {  id = 3,  jsonrpc = "2.0",  method = "shutdown"}
[DEBUG][2024-06-20 08:47:00] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  id = 3,  jsonrpc = "2.0"}
[DEBUG][2024-06-20 08:47:00] .../vim/lsp/rpc.lua:286    "rpc.send"  {  jsonrpc = "2.0",  method = "exit"}
xna00 commented 1 month ago

I released 0.1.4, hope it works.

siduck commented 1 month ago
[START][2024-06-20 09:50:29] LSP logging initiated
[INFO][2024-06-20 09:50:29] .../vim/lsp/rpc.lua:731 "Starting RPC client"   {  cmd = { "/home/siduck/.local/share/nvim/mason/bin/unocss-language-server", "--stdio" },  extra = {    cwd = "/home/siduck/ors"  }}
[DEBUG][2024-06-20 09:50:29] .../vim/lsp/rpc.lua:286    "rpc.send"  {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      general = {        positionEncodings = { "utf-16" }      },      textDocument = {        callHierarchy = {          dynamicRegistration = false        },        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = true,          isPreferredSupport = true,          resolveSupport = {            properties = { "edit" }          }        },        colorProvider = {          dynamicRegistration = true        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },            preselectSupport = false,            snippetSupport = false          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          completionList = {            itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          dynamicRegistration = true,          linkSupport = true        },        diagnostic = {          dynamicRegistration = false        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        formatting = {          dynamicRegistration = true        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = true        },        implementation = {          linkSupport = true        },        inlayHint = {          dynamicRegistration = true,          resolveSupport = {            properties = { "textEdits", "tooltip", "location", "command" }          }        },        publishDiagnostics = {          dataSupport = true,          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        rangeFormatting = {          dynamicRegistration = true        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = true,          prepareSupport = true        },        semanticTokens = {          augmentsSyntaxTokens = true,          dynamicRegistration = false,          formats = { "relative" },          multilineTokenSupport = false,          overlappingTokenSupport = true,          requests = {            full = {              delta = true            },            range = false          },          serverCancelSupport = false,          tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" },          tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = true,          willSaveWaitUntil = true        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = true        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        didChangeConfiguration = {          dynamicRegistration = false        },        didChangeWatchedFiles = {          dynamicRegistration = false,          relativePatternSupport = true        },        inlayHint = {          refreshSupport = true        },        semanticTokens = {          refreshSupport = true        },        symbol = {          dynamicRegistration = false,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.10.0-dev"    },    initializationOptions = vim.empty_dict(),    processId = 20732,    rootPath = "/home/siduck/ors",    rootUri = "file:///home/siduck/ors",    trace = "off",    workDoneToken = "1",    workspaceFolders = { {        name = "/home/siduck/ors",        uri = "file:///home/siduck/ors"      } }  }}
[DEBUG][2024-06-20 09:50:29] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  jsonrpc = "2.0",  method = "window/logMessage",  params = {    message = "unocss: before add onCompletion listener",    type = 4  }}
[INFO][2024-06-20 09:50:29] ...lsp/handlers.lua:627 "unocss: before add onCompletion listener"
[DEBUG][2024-06-20 09:50:29] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  jsonrpc = "2.0",  method = "window/logMessage",  params = {    message = "unocss: after add listener",    type = 4  }}
[INFO][2024-06-20 09:50:29] ...lsp/handlers.lua:627 "unocss: after add listener"
[DEBUG][2024-06-20 09:50:29] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  id = 1,  jsonrpc = "2.0",  result = {    capabilities = {      colorProvider = true,      completionProvider = {        resolveProvider = true      },      documentHighlightProvider = false,      hoverProvider = true,      textDocumentSync = 2,      workspace = {        workspaceFolders = {          supported = true        }      }    }  }}
[DEBUG][2024-06-20 09:50:29] .../vim/lsp/rpc.lua:286    "rpc.send"  {  jsonrpc = "2.0",  method = "initialized",  params = vim.empty_dict()}
[DEBUG][2024-06-20 09:50:29] .../vim/lsp/rpc.lua:286    "rpc.send"  {  jsonrpc = "2.0",  method = "textDocument/didOpen",  params = {    textDocument = {      languageId = "html",      text = "\n<div class='bg-red-100 text-blue'></div>\n",      uri = "file:///home/siduck/ors/src/a.html",      version = 0    }  }}
[DEBUG][2024-06-20 09:50:30] ...m/lsp/client.lua:676    "LSP[unocss]"   "client.request"    1   "textDocument/documentColor"    {  textDocument = {    uri = "file:///home/siduck/ors/src/a.html"  }}   <function 1>    1
[DEBUG][2024-06-20 09:50:30] .../vim/lsp/rpc.lua:286    "rpc.send"  {  id = 2,  jsonrpc = "2.0",  method = "textDocument/documentColor",  params = {    textDocument = {      uri = "file:///home/siduck/ors/src/a.html"    }  }}
[INFO][2024-06-20 09:50:30] ...m/lsp/client.lua:618 "LSP[unocss]"   "server_capabilities"   {  server_capabilities = {    colorProvider = true,    completionProvider = {      resolveProvider = true    },    documentHighlightProvider = false,    hoverProvider = true,    textDocumentSync = {      change = 2,      openClose = true,      save = {        includeText = false      },      willSave = false,      willSaveWaitUntil = false    },    workspace = {      workspaceFolders = {        supported = true      }    }  }}
[DEBUG][2024-06-20 09:50:30] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  id = 2,  jsonrpc = "2.0",  result = {}}

didnt work :disappointed:

xna00 commented 1 month ago

Please try 0.1.5.

siduck commented 1 month ago

it works now, btw would it be possible to support the attributes too or thats out of scope?

top one's vscode

image