Skip to content

Commit

Permalink
changing fileops to file, other scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Dec 4, 2024
1 parent 8322bb7 commit 950ff17
Show file tree
Hide file tree
Showing 18 changed files with 625 additions and 223 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Chris Pecunies
Copyright (c) 2024 Chris Pecunies

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 15 additions & 0 deletions book/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `word.lua` Book Index

## About

## Links

## Roadmap

### For next version

### For future versions

### For later future

## Bugs
3 changes: 1 addition & 2 deletions book/src/modules/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,5 @@ end

return M
```
- See [example.lua](../../lua/module/example.lua)


- See [example.lua](../../lua/module/example.lua)
File renamed without changes.
76 changes: 71 additions & 5 deletions lua/word/mod/integration/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,71 @@
local E = require('word.mod').create('integration', {
'treesitter',
'telescope',
'blink',
})
---TODO: imelement
local E = require('word.mod').create('integration')

--TODO: implement config to initialize sub integrations depending on user config

---@class word.integration.Config
E.config.public = {
---@brief List of integrations to disable (relative to the integration dir)
disabled = {

},
---@brief List of integrations to enable (relative to the integration dir)
enabled = {
"telescope",
"treesitter",
}
}

---@class word.integration.Data
E.data = {

}

---@param ext string
---@return string
E.data.get = function(ext)
end

---TODO: implement
---Returns either a table of the loaded dependencies or nil of one is unsuccessful
---@return table<string, any>|nil: the loaded dependency package
---@param ext string: the integration module to check
E.data.deps = function(ext)
return nil
end
E.data.enabled = {
}

---@return boolean, nil|nil
---@param ext string
E.data.has = function(ext)
return pcall(require, ext)
end

--- Generic setup function for integration submodules
--- @param ext string: the integration to setup
--- @param req table<string>: the modules required by the integration module
--- @return word.mod.Setup
E.data.setup = function(ext, req)
local ok, e = E.data.has(ext)
if ok then return {
requies = req,
loaded = true
}
else return {
loaded = false
}
end
end

E.setup = function()
local enabled = {

}
return {
loaded = true,
requires = enabled
}
end

return E
33 changes: 33 additions & 0 deletions lua/word/mod/integration/trouble/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
local mod = require "word.mod"
---@alias word.integration.trouble.Trouble word.Mod
local T = mod.create("integration.trouble")
local tok, t = pcall(require, "trouble")

---@class word.integration.trouble.Data
T.data = {

}

T.setup = function()
if not tok then return {
loadeed = false
}
else return {
loaded = true,
requires = {
"ui",
"ui.win",
"ui.popup"
}
}
end
end

---@class word.integration.trouble.Config
T.config.public = {

}



return T
10 changes: 5 additions & 5 deletions lua/word/mod/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ M.setup = function()
"lsp.document.format",
"lsp.document.lens",
"lsp.document",
"lsp.workspace.fileops",
"lsp.workspace.file",
"lsp.document.semantic",
"lsp.refactor",
"lsp.document.action",
Expand Down Expand Up @@ -139,8 +139,8 @@ M.data = {
hover = Mod.get_mod("lsp.document.hover"),
---@type lsp.refactor
refactor = Mod.get_mod("lsp.refactor"),
---@type lsp.workspace.fileops
ws_fileops = Mod.get_mod("lsp.workspace.fileops"),
---@type lsp.workspace.file
ws_file = Mod.get_mod("lsp.workspace.file"),
---@type lsp.workspace.edit
ws_edit = Mod.get_mod("lsp.workspace.edit"),
---@type lsp.workspace.diagnostic
Expand Down Expand Up @@ -320,7 +320,7 @@ M.load = function()
})
end
M.data.ts = Mod.get_mod("integration.treesitter")
M.data.workspace_fileops = Mod.get_mod("lsp.workspace.fileops")
M.data.workspace_file = Mod.get_mod("lsp.workspace.file")
M.data.workspace = Mod.get_mod("workspace")
M.data.lsp_ws = Mod.get_mod("lsp.workspace")
M.data.lsp_doc = Mod.get_mod("lsp.document")
Expand Down Expand Up @@ -371,7 +371,7 @@ end
M.data.capabilities = {
workspace = {
---@type lsp.FileOperationOptions
fileOperations = Mod.get_mod("lsp.workspace.fileops").opts,
fileOperations = Mod.get_mod("lsp.workspace.file").opts,
workspaceFolders = Mod.get_mod("lsp.workspace.folders").server.capabilities,
-- workspaceSymbolProvider = Mod.get_mod("lsp.workspace.symbol").opts,
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local F = Mod.create("lsp.workspace.fileops")
local F = Mod.create("lsp.workspace.file")

function F.setup()
return {
Expand All @@ -9,7 +9,7 @@ function F.setup()
}
end

---@class lsp.workspace.fileops
---@class lsp.workspace.file
F.data = {
---@type lsp.FileOperationClientCapabilities
capabilities = {
Expand Down
2 changes: 1 addition & 1 deletion lua/word/mod/lsp/workspace/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local M = Mod.create("lsp.workspace", {
"folders",
"edit",
"diagnostic",
"fileops",
"file",
"symbol",
})

Expand Down
Empty file.
10 changes: 8 additions & 2 deletions lua/word/mod/lsp/workspace/tag/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local M = Mod.create("lsp.workspace.tag")
local M = require("word.mod").create("lsp.workspace.tag")

function M.setup()
return {
Expand All @@ -9,6 +9,12 @@ function M.setup()
}
end

---@class lsp.workspace.symbol
---@class word.lsp.workspace.tag.Data
M.data = {}

---@class word.lsp.workspace.tag.Config
M.config.public = {
enable = true,
}

return M
Loading

0 comments on commit 950ff17

Please sign in to comment.