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

refactor(type): add type annotation for defaults.lua #1333

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
014f98a
refactor(type): add type annotation for defaults.lua
pysan3 Feb 2, 2024
efcefd7
ci(lua_ls): add lua_ls actions to check type annotation
pysan3 Feb 2, 2024
fde92b3
chore: autoformat with stylua
pysan3 Feb 2, 2024
0c048b4
ci(lua_ls): force run type check on all branches for now
pysan3 Feb 2, 2024
5b8f58c
Merge branch 'add-type-annotations' of github.com:pysan3/neo-tree.nvi…
pysan3 Feb 2, 2024
f5d2207
fix(ci): fix typo
pysan3 Feb 2, 2024
913d998
ci(lua_ls): refer to types defined in the repo
pysan3 Feb 2, 2024
adee9b9
fix(type): better organized type names
pysan3 Feb 2, 2024
72776bc
refactor(type): move config types to another file
pysan3 Feb 3, 2024
ead7513
refactor(type): add types to log.lua
pysan3 Feb 3, 2024
e6236b9
refactor(type): add type for merge_config
pysan3 Feb 5, 2024
c331b7b
ci(lua_ls): add more files to check types
pysan3 Feb 5, 2024
4cfcbe2
refactor(defaults): move event_handler examples to wiki
pysan3 Feb 5, 2024
4b68620
refactor(types): add type files to library
pysan3 Feb 5, 2024
7744d57
refactor(types): ignore wrong or deprecated types
pysan3 Feb 5, 2024
e85fdcc
ci(lua_ls): remove unnecessary types to check
pysan3 Feb 5, 2024
a28b905
refactor(types): remove collections.lua from type check
pysan3 Feb 5, 2024
c4ab2c3
ci(lua_ls): make lua_ls typecheck run on PRs
pysan3 Feb 5, 2024
9ce9563
fix(type): add lacking field
pysan3 Feb 6, 2024
b42cefe
refactor(type): delete types to prevent lua_ls performance issue
pysan3 Feb 9, 2024
12a67ae
refactor(type): move component types to separate file
pysan3 Feb 9, 2024
710ddaf
refactor(type): add types to functions in common/components
pysan3 Feb 9, 2024
c1eaadb
refactor(type): capitalize all enum keys
pysan3 Feb 11, 2024
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
Prev Previous commit
Next Next commit
refactor(types): ignore wrong or deprecated types
  • Loading branch information
pysan3 committed Feb 5, 2024
commit 7744d57a582d00450299e026c5811edd3063d288
7 changes: 4 additions & 3 deletions lua/neo-tree/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ local default_config = {
float_precision = 0.01,
}

local unpack = unpack or table.unpack
local unpack = unpack or table.unpack ---@diagnostic disable-line

---Round float at a certain precision
---@param x number
---@param increment number # The smallest digit where `x` will be rounded. `0.1` will output `nn.n`.
Expand Down Expand Up @@ -112,7 +113,7 @@ log.new = function(config, standalone)
for i, v in ipairs(obj.config.modes) do
obj.levels[v.name] = i
end
obj.use_file = function(file, quiet)
obj.use_file = function(file, quiet) ---@diagnostic disable-line
obj.config.use_file = file ~= false ---@diagnostic disable-line
if file == false then
if not quiet then
Expand All @@ -127,7 +128,7 @@ log.new = function(config, standalone)
end
end
end
obj.set_level = function(level)
obj.set_level = function(level) ---@diagnostic disable-line
if obj.levels[level] then
if obj.config.level ~= level then
obj.config.level = level
Expand Down
Loading