Skip to content

chore: add type annotations and resolve LSP warnings #2555

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

Merged
merged 28 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fabea33
chore: add type annotations to (almost) all functions
Akmadan23 Nov 24, 2023
0b31f06
stylua
Akmadan23 Nov 24, 2023
adeec1a
Merge branch 'master' into type-annotations
Akmadan23 Nov 24, 2023
76c88de
Add classes for symlink nodes
Akmadan23 Nov 25, 2023
2a6aa31
Replace deprecated `@vararg`
Akmadan23 Nov 26, 2023
3b66519
Move node classes to `node` module
Akmadan23 Nov 26, 2023
3af30ee
Fix `Symlink*` classes
Akmadan23 Nov 26, 2023
8393f7c
add vim and libuv runtime for luals, qualify libuv types
alex-courtis Nov 26, 2023
c70229c
add scripts/luals-check, not quite ready for CI
alex-courtis Nov 26, 2023
b4570bd
additional nil checks for git/init.lua and git/runner.lua
alex-courtis Nov 26, 2023
15f05f8
additional nil checks for nvim-tree.lua
alex-courtis Nov 26, 2023
6988062
wrap vim.cmd-as-a-function calls inside functions
alex-courtis Nov 26, 2023
87d2d4f
vim.tbl_filter predicate returns booleans
alex-courtis Nov 26, 2023
e201c5b
Revert "add scripts/luals-check, not quite ready for CI"
alex-courtis Nov 27, 2023
03ceffc
Add `MinimalNode` class in `marks` module
Akmadan23 Nov 27, 2023
0fb4f96
Merge branch 'master' into type-annotations
Akmadan23 Nov 27, 2023
ee60886
Fix various LSP warnings
Akmadan23 Nov 28, 2023
dcd8cb8
Merge branch 'master' into type-annotations
Akmadan23 Nov 28, 2023
b4ea048
stylua
Akmadan23 Nov 28, 2023
e0cacc9
Fix `Explorer` class, update related annotations and add necessary ch…
Akmadan23 Nov 28, 2023
d16f289
Add missing annotations to `live-filter`
Akmadan23 Nov 30, 2023
a937cda
Add temporary aliases for `uv.*` types
Akmadan23 Dec 4, 2023
ec16b1a
Resolve remaining LSP warnings
Akmadan23 Dec 4, 2023
aafccdc
Merge branch 'master' into type-annotations
Akmadan23 Dec 5, 2023
d14eb6f
Revert changes not related to internal types
Akmadan23 Dec 5, 2023
edc0d63
Minor adjustments
Akmadan23 Dec 5, 2023
9ff04a9
Update doc comments style
Akmadan23 Dec 5, 2023
7fbc416
Minor adjustments (pt. 2)
Akmadan23 Dec 6, 2023
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
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

11 changes: 7 additions & 4 deletions lua/nvim-tree/marks/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ local NvimTreeMarks = {}

local M = {}

---@param node Node
---@class MinimalNode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow... I like this one... I'm seeing many possibilities.

---@field absolute_path string

---@param node Node|MinimalNode
local function add_mark(node)
NvimTreeMarks[node.absolute_path] = node

renderer.draw()
end

---@param node Node
---@param node Node|MinimalNode
local function remove_mark(node)
NvimTreeMarks[node.absolute_path] = nil

renderer.draw()
end

---@param node Node
---@param node Node|MinimalNode
function M.toggle_mark(node)
if node.absolute_path == nil then
return
Expand All @@ -39,7 +42,7 @@ function M.clear_marks()
renderer.draw()
end

---@param node Node
---@param node Node|MinimalNode
---@return table|nil
function M.get_mark(node)
return NvimTreeMarks[node.absolute_path]
Expand Down
47 changes: 0 additions & 47 deletions scripts/luals-check

This file was deleted.