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

Add type annotations to improve development experience #300

Closed
jakubbortlik opened this issue May 9, 2024 · 2 comments
Closed

Add type annotations to improve development experience #300

jakubbortlik opened this issue May 9, 2024 · 2 comments
Labels
question Further information is requested

Comments

@jakubbortlik
Copy link
Collaborator

Feature Description

When working on the plugin, I'm getting a lot of warnings about undefined types, e.g., NuiTree or NuiTree.Node:
image
@harrisoncramer , do you also get these warnings or I am just missing something? The many warnings make it easier to miss some more relevant problems with the code.
In #299, I've added an annotation for RootNode (lua/gitlab/actions/discussions/annotations.lua:137), precisely to get rid of some irrelevant warnings. If there is no better way, I'd suggest to add annotations also for a regular Node and for NuiTree. Or maybe this should be done in the nui.nvim library, I don't know.

@harrisoncramer
Copy link
Owner

harrisoncramer commented May 27, 2024

I don't have this problem as my editor imports these annotations from the NUI library. If you're using the built-in LSP for Neovim you may have to tell it to be aware of runtime files. You can see my configuration for the LSP here, specifically check out the settings section:

https://github.com/harrisoncramer/nvim/blob/main/lua/lsp/servers/lua-language-server.lua

@harrisoncramer harrisoncramer added the question Further information is requested label May 27, 2024
@jakubbortlik
Copy link
Collaborator Author

Thanks for the tip, unfortunately, I already have the same settings in my config, I've tried printing out the settings with which the server is being set up and I can see that the path to nui.nvim is included in the workspace. Still, I'm getting all the warnings. I'll have to figure this out on my own I guess, as I'm using (mason-lspconfig)[https://github.com/williamboman/mason-lspconfig.nvim], but I've not reviewed the configuration in a long time, so hopefully I'll find a way how to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants