Skip to content

begin using emmylua_ls #33344

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

lewis6991
Copy link
Member

@lewis6991 lewis6991 commented Apr 6, 2025

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.

@github-actions github-actions bot added build building and installing Neovim using the provided scripts lsp labels Apr 6, 2025
@clason

This comment was marked as resolved.

@telemachus

This comment was marked as resolved.

@clason

This comment was marked as resolved.

@@ -88,6 +88,7 @@ local function modifiers_from_number(x, modifiers_table)
return modifiers
end

--- @async
Copy link
Member

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?

Copy link
Member Author

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.

@lewis6991 lewis6991 added the DO NOT MERGE Nothing to see here; move along label Apr 7, 2025
emmylua-check: luv
-emmylua_check \
--output-format=json \
--config=$(PWD)/.luarc.json \
Copy link
Contributor

@lithammer lithammer Apr 16, 2025

Choose a reason for hiding this comment

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

You probably want to use CURDIR instead of PWD. The latter will be incorrect with make -C <path> (among other things). In fact, you basically never want to use PWD.

Explained well here: https://stackoverflow.com/a/52447088

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I'll make sure to use CURDIR instead from now on. This target is only temporary. The final form will be in cmake.

@lewis6991 lewis6991 mentioned this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build building and installing Neovim using the provided scripts DO NOT MERGE Nothing to see here; move along lsp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants