-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
43 lines (33 loc) · 1.03 KB
/
Copy pathinit.lua
File metadata and controls
43 lines (33 loc) · 1.03 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
local M = {}
local source = require("css-angular.source")
local externals = require("css-angular.externals")
local extractor = require("css-angular.extractor")
local ss = require("css-angular.style_sheets")
local internal = require("css-angular.internal")
local config = require("css-angular.config").config
local source_name = "css-angular"
vim.print("inti css")
---@type string[]
local enable_on_dto = {}
if config.enable_on ~= nil then
for _, ext in pairs(config.enable_on) do
vim.print(ext)
table.insert(enable_on_dto, "*." .. ext)
end
end
function M:setup()
require("cmp").register_source(source_name, source)
if config.style_sheets ~= nil and #config.style_sheets ~= 0 then
ss.init(config.style_sheets)
end
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePre", "WinEnter" }, {
pattern = enable_on_dto,
callback = function(event)
local hrefs = extractor.href(config.style_sheets)
vim.cmd('echoerr "error"')
externals.init(event.buf, hrefs)
internal.init(event.buf, event.file)
end,
})
end
return M