Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hover): add syntax highlighting for tailwindcss #1352

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lua/lspsaga/hover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ function hover:do_request(args)
if type(result.contents) == 'string' then -- MarkedString
value = result.contents
elseif result.contents.language then -- MarkedString
value = result.contents.value
if result.contents.language == 'css' then -- tailwindcss
value = '```css\n' .. result.contents.value .. '\n```'
else
value = result.contents.value
end
elseif vim.tbl_islist(result.contents) then -- MarkedString[]
if vim.tbl_isempty(result.contents) and ignore_error(args) then
vim.notify('No information available')
Expand Down
19 changes: 10 additions & 9 deletions lua/lspsaga/symbol/winbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ local function path_in_bar(buf)
for item in util.path_itera(buf) do
item = #items == 0
and '%#' .. (hl or 'SagaFileIcon') .. '#' .. (icon and icon .. ' ' or '') .. '%*' .. bar.prefix .. 'FileName#' .. item .. '%*'
or bar.prefix .. 'Folder#' .. (folder and folder or '') .. '%*' .. bar.prefix .. 'FolderName#' .. item .. '%*'
or bar.prefix
.. 'Folder#'
.. (folder and folder or '')
.. '%*'
.. bar.prefix
.. 'FolderName#'
.. item
.. '%*'
items[#items + 1] = item

if #items > config.folder_level then
Expand Down Expand Up @@ -104,14 +111,8 @@ local function insert_elements(buf, node, elements)
local node_context = string.format('%s%s#%s%s', bar.prefix, type, icon, node.name)
elements[#elements + 1] = node_context
else
elements[#elements + 1] = string.format(
'%s%s#%s%sWord#%s',
bar.prefix,
type,
icon,
bar.prefix,
node.name
)
elements[#elements + 1] =
string.format('%s%s#%s%sWord#%s', bar.prefix, type, icon, bar.prefix, node.name)
end
end

Expand Down
Loading