-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
begin using emmylua_ls #33344
base: master
Are you sure you want to change the base?
begin using emmylua_ls #33344
Conversation
Note: these luacats files seem umaintained. We should try to get them upstreamed (so we can point to them in our (They're the exact same ones luals uses, though.) |
594d018
to
5d4ea53
Compare
5d4ea53
to
e2b14a6
Compare
Agreed. I don't know about the other repos, but I've had an open PR on LuaCATS/luv for nearly a year with no response. The larger point being that without some tweaking, I wasn't able to get that repo to work. |
Yes, that's how I could tell :) |
@@ -88,6 +88,7 @@ local function modifiers_from_number(x, modifiers_table) | |||
return modifiers | |||
end | |||
|
|||
--- @async |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the implications of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any function that has a route to coroutine.yield()
is marked by the tool as async. The @async
annotation is make this explicit. This helps find bugs where the code is called from the main thread but acidentally enters a code path that may yield.
I've got gitsigns fully typed with @async
here and have found it a very useful diagnostic as it finds places where functions that are expected to execute synchronously are calling async functions.
"${3rd}/busted/library", | ||
"${3rd}/luv/library" | ||
"luv" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be better to add a separate emmyrc.json
for a sliding migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I don't plan on merging this as-is, just a place to hold all the fixes so I can post issues upstream.
Once this gets big enough, I'll cherry pick all the changes which are LuaLS compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, assuming (as I do) that we'll eventually want to migrate, would it then(!) make sense to bundle a preconfigured lsp/emmyluals.lua
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too early to tell. EmmyLuaLs is compatible with .luarc.json
. The main difference atm is the libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The same applies to lsp/luals.lua
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry I misunderstood the question. Yeah sure, we can bundle both.
|
||
.PHONY: emmylua-check | ||
emmylua-check: luv | ||
emmylua_check --config=$(PWD)/.luarc.json runtime/lua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least for the purpose of testing in this PR, I'd just vendor these files as runtime/lua/vim/uv/_meta/*
; then emmyluals will pick them up automatically (also in downstream projects).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, vendoring will be best just so uv
is available in $VIMRUNTIME
.
3d1334c
to
c71353e
Compare
I don't plan on merging this as-is, just a place to hold all the fixes so I can post issues upstream.
Once this gets big enough, I'll cherry pick all the changes which are LuaLS compatible.