-
Notifications
You must be signed in to change notification settings - Fork 12
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
feature: load library on filename #39
Comments
Isn't something like the below enough? { "LuaCATS/luassert", name = "luassert-types", lazy = true },
{ "LuaCATS/busted", name = "busted-types", lazy = true },
{
"folke/lazydev.nvim",
opts = function(_, opts)
vim.list_extend(opts.library, {
{ path = "luassert-types/library", words = { "assert" } },
{ path = "busted-types/library", words = { "describe" } },
})
end,
}, |
No it's not enough Problem is that all of the xmake functions are in global scope and have no common denominator Here's example xmake: -- xmake.lua
target("library")
set_kind("static")
add_files("src/library/*.c")
target("test")
set_kind("binary")
add_files("src/*.c")
add_deps("library") And same thing would be apply for premake: -- premake5.lua
workspace "HelloWorld"
configurations { "Debug", "Release" }
project "HelloWorld"
kind "ConsoleApp"
language "C"
targetdir "bin/%{cfg.buildcfg}"
files { "**.h", "**.c" }
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On" Both of them use global space functions and don't have unique enough words that you wouldn't encounter when coding normally to identify by, so identifying by file is needed |
I don't see the issue tbh. Just add all the words? Or at least the most common ones? |
You could probably also just add |
or feel free to provide a PR... |
I'll do a PR then, could you reopen issue please? |
🤖 I have created a release *beep* *boop* --- ## [1.7.0](v1.6.0...v1.7.0) (2024-07-04) ### Features * added `files` option [#39](#39) ([#41](#41)) ([380e80d](380e80d)) * added support for luarocks installed with lazy ([e3d0d55](e3d0d55)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.7.0](v1.6.0...v1.7.0) (2024-07-14) ### Features * added `files` option [#39](#39) ([#41](#41)) ([380e80d](380e80d)) * added support for luarocks installed with lazy ([e3d0d55](e3d0d55)) ### Bug Fixes * **util:** notify ([a74b397](a74b397)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Did you check the docs?
Is your feature request related to a problem? Please describe.
I'm adding xmake library definitions which all live in global space (i.e without
require("xmake")
), so all of functions likeadd_rules
,target
.. that are defined by xmake are suggested in all lua filesDescribe the solution you'd like
Allow loading library when opening file with certain name, i.e with this configuration:
xmake-luals-addon would only load when I'm opening
xmake.lua
Describe alternatives you've considered
Writing enable function that would detect filename, but that'd colide with other library definitions
Additional context
No response
The text was updated successfully, but these errors were encountered: