- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Example for nix setup with neodev. #34
Comments
Hey 👋 There are two ways you can solve the
{
"Lua.diagnostics.globals": ["vim"]
} or
Footnotes
|
Thanks for you quick response! 1 is a no-go for me since I wanted to check if I'm calling the vim apis correctly as well. I managed to set it up so I'd like to share here for others.
// ./.github/workflows/.luarc.json
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime.version": "LuaJIT",
"runtime.path": [
"lua/?.lua",
"lua/?/init.lua"
],
"workspace.library": [
"/github/workspace/deps/neodev.nvim/types/stable",
"${3rd}/busted/library"
],
"diagnostics.libraryFiles": "Disable",
"workspace.checkThirdParty": "Disable"
} # ./.github/workflows/lua_ls-typecheck.yml
# you could add `tests` folder at the end but it will raise errors for `describe, it, ...` anyways...
name: lua_ls-typecheck
on:
pull_request: ~
push:
branches:
- '*'
jobs:
build:
name: Type Check Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Checkout dependency neodev
uses: actions/checkout@v3
with:
repository: "folke/neodev.nvim"
path: "deps/neodev.nvim"
- name: Type Check Code Base
uses: mrcjkb/[email protected]
with:
configpath: .github/workflows/.luarc.json
directories: |
lua Read this quote before you do anything if you are following this snippet. From my experience of introducing style / type / lint / diagnostic checks to whole (non-confirming) database the best way was to add the checker with corresponding check steps in pipeline and simultaneously put every checkable code file into global ignore file (effectively making the check noop) in the first PR and then fix and take out modules/files one by one from ignore file in multiple separate subsequent PRs. This way has almost no friction for finishing and merging existing PRs. If some friction is okay: the first step shouldn't put files into ignore list if they're green initially. Originally posted by @Anrock in nvim-neorg/neorg#1161 (comment) EDIT: |
That's great to hear 🚀 Thanks for sharing your solution! |
Amazing! That'll help a lot of people. Btw do you know any way to add type notation for describe, it, etc coming from busted? I wished there was something like neodev for that but unfortunately I couldn't find a solution other than sticking them into diagnostic.global. |
I've been trying to get that working with Nix in my plugins. But so far without success 😞. |
I see. I'll look into it but they also don't have much documentation so I don't think it'll be a good reference lol. |
shouldn't that be possible because those types are builtin with luals? {
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime.version": "LuaJIT",
"runtime.path": [
"lua/?.lua",
"lua/?/init.lua"
],
"workspace.library": [
"/github/workspace/deps/neodev.nvim/types/stable",
"${3rd}/busted/library"
],
"diagnostics.libraryFiles": "Disable",
"workspace.checkThirdParty": "Disable"
} |
BTW @mrcjkb I added a caution in the above comment: #34 (comment), that might be worth mentioning. Would you agree to add this comment to the wiki as well? |
OMG it works! You are my god! I don't think I heard about this anywhere else or even by googling. You gotta spread your words more lol. |
Sure, that sounds reasonable. |
Nice! This (and I just checked the docs. Apparently, setting |
quite sure that setting would just prompt you to add the library to workspace.library when e.g. starting neovim |
Ahh, I'm using the |
Looks like |
I was using deprecated |
Hi, I came across this action and I'm currently trying to integrate it into my plugin.
Being able to do type check before all commits would be amazing!
However, all files are raising errors since they cannot find the
vim
global variable at the moment.When I look at your
haskell-tools.nvim
, you are doing some nix magic to install neodev and other plugins.I don't have any experience with nix or nixos, so I'd be glad if you could give me an example of how to setup neovim with neodev installed to use this action.
Thanks in advance!
The text was updated successfully, but these errors were encountered: