Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Dec 23, 2024
1 parent 91e043a commit ce4a145
Show file tree
Hide file tree
Showing 68 changed files with 1,385 additions and 2,912 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ downls
.pre-commit-config.yaml
/doc/tags
**ext/sublime
**autoload/
**ext/v
**ext/oc
**ext/helix
**ext/zed
# **ext/lsp
**ext/rust-lsp
**ext/nim
**.book/
Expand Down
2 changes: 1 addition & 1 deletion ext/lsp
Submodule lsp updated 123 files
60 changes: 30 additions & 30 deletions lua/down.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@

---@class down.down
local W = {
cfg = require("down.config").config,
mod = require("down.mod"),
config = require("down.config"),
callbacks = require("down.util.event.callback"),
log = require("down.util.log"),
types = require("down.types"),
health = require("down.health"),
core = require("down.core"),
cfg = require('down.config').config,
mod = require('down.mod'),
config = require('down.config'),
callbacks = require('down.util.event.callback'),
log = require('down.util.log'),
health = require('down.health'),
core = require('down.core'),
util = {
util = require("down.util"),
log = require("down.util.log"),
buf = require("down.util.buf"),
util = require('down.util'),
log = require('down.util.log'),
buf = require('down.util.buf'),
-- cb = require("down.event.cb"),
},
utils = require("down.util"),
lib = require("down.util.lib"),
utils = require('down.util'),
lib = require('down.util.lib'),
}

-- local e = require("down")
local con, log, m, utils = require("down.config").config, W.log, W.mod, W.utils
local con, log, m, utils = require('down.config').config, W.log, W.mod, W.utils
local a, f, ext = vim.api, vim.fn, vim.tbl_deep_extend

--- @init "down.config"
Expand All @@ -44,8 +43,8 @@ function W.setup(conf)
end
con.user = utils.extend(con.user, conf)
-- log.new(con.user.logger or log.get_base_config(), true)
require("down.config").setup_maps()
require("down.config").setup_opts()
require('down.config').setup_maps()
require('down.config').setup_opts()

if W.util.buf.check_md() or not con.user.lazy then
W.enter(false)
Expand All @@ -54,14 +53,15 @@ function W.setup(conf)
-- vim.cmd.delcommand("downInit")
-- W.enter(true)
-- end, {})

a.nvim_create_autocmd("BufAdd", {
pattern = "markdown",
a.nvim_create_autocmd('BufAdd', {
pattern = { 'markdown' },
callback = function()
W.enter(false)
end,
})
end
require 'down.util.lsp'.setup()
require 'down.util.lsp'.run()
end

---@param manual table
Expand All @@ -76,7 +76,7 @@ function W.enter(manual, args)
end
con.manual = manual
if args and args:len() > 0 then
for key, value in args:gmatch("([%w%W]+)=([%w%W]+)") do
for key, value in args:gmatch('([%w%W]+)=([%w%W]+)') do
con.args[key] = value
end
end
Expand All @@ -86,7 +86,7 @@ function W.enter(manual, args)
end
for name, _ in pairs(mods) do
if not m.load_mod(name) then
log.warn("Error recovery")
log.warn('Error recovery')
m.loaded_mod[name] = nil
end
end
Expand All @@ -96,23 +96,23 @@ function W.enter(manual, args)
con.started = true

m.broadcast({
type = "started",
type = 'started',
split_type = {
"started",
'started',
},
filename = "",
filehead = "",
filename = '',
filehead = '',
cursor_position = { 0, 0 },
referrer = "config",
topic = "started",
line_content = "",
referrer = 'config',
topic = 'started',
line_content = '',
broadcast = true,
buffer = a.nvim_get_current_buf(),
window = a.nvim_get_current_win(),
mode = f.mode(),
})
vim.api.nvim_exec_autocmds("User", {
pattern = "downLoaded", --
vim.api.nvim_exec_autocmds('User', {
pattern = 'downLoaded', --
})
end

Expand Down
51 changes: 0 additions & 51 deletions lua/down/core/data/cache.lua
Original file line number Diff line number Diff line change
@@ -1,52 +1 @@
---@class down.core.data.cache.Cache
---@field public head any
---@field public tail any
---@field public len integer
---@field public cache table<any, any>
---@field public cap integer
local Cache = {}

Cache.__index = Cache

function Cache.newcache() end

function Cache.new(cap)
local c = {
head = nil,
tail = nil,
len = 0,
cap = cap,
cache = { }
}
return setmetatable({
__index = c,
}, c)
end

Cache.__len = function()
return Cache.len
end

function Cache:set(k, v)
self.cache[k] = v
end

function Cache.__newindex(self, k, v)
self.set(k, v)
end

Cache.__tostring = function(self)
local s = ""
for ii, i in ipairs(self.cache) do
s = s .. tostring(ii) .. tostring(i)
end
return s
end

function Cache:del() end

function Cache:clear() end

function Cache:get() end

return Cache
3 changes: 0 additions & 3 deletions lua/down/core/data/store.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
---@class down.core.data.store.Store
local S = {}

return S
2 changes: 1 addition & 1 deletion lua/down/core/parse/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---@class down.core.parse.Parse
local P = {}


local l = vim.lpeg

return P
Empty file removed lua/down/lsp/completion/init.lua
Empty file.
Empty file removed lua/down/lsp/core/init.lua
Empty file.
Empty file removed lua/down/lsp/document/init.lua
Empty file.
166 changes: 0 additions & 166 deletions lua/down/lsp/init.lua

This file was deleted.

19 changes: 0 additions & 19 deletions lua/down/lsp/main.lua

This file was deleted.

2 changes: 0 additions & 2 deletions lua/down/lsp/notebook/init.lua

This file was deleted.

Loading

0 comments on commit ce4a145

Please sign in to comment.