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

workspace.library works for the addon, but workspace.userThirdParty does not #3046

Closed
evmorov opened this issue Jan 18, 2025 · 1 comment
Closed

Comments

@evmorov
Copy link

evmorov commented Jan 18, 2025

This is more of a question than a bug report because I might be doing something wrong.

Here's my simple code using the lpeg Lua library I installed using luarocks:

local lpeg = require("lpeg")

p = lpeg.R("az") ^ 1 * -1
print(p:match("hello"))
print(lpeg.match(p))

It works (an intentional error is included to test the LSP Addon).

I downloaded the lpeg addon from here: https://github.com/LuaCATS/lpeg.

evgenii.morozov:~/projects/lls-addons $ tree
.
└── lpeg
    ├── LICENSE
    ├── README.md
    ├── config.json
    └── library
        └── lpeg.lua

I added the following .luarc.json to the root of my project:

{
  "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
  "workspace.library": [
    "~/projects/lls-addons/lpeg/library"
  ]
}

This setup works. However, if I change it to:

{
  "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
  "workspace.checkThirdParty": "Apply",
  "workspace.userThirdParty": [
    "~/projects/lls-addons"
  ]
}

It doesn't work. According to https://luals.github.io/wiki/addons/#automatically-enabling, it seems it should be automatically enabled because the addon includes config.json.

Am I missing something?

My env:

  • MacOS
  • Using both VSCode and Intellij IDEA
  • Lua 5.4.7
@evmorov
Copy link
Author

evmorov commented Jan 18, 2025

userThirdParty does't support ~, while library supports it.

.luarc.json:

  "workspace.userThirdParty": [
    "/Users/evgenii.morozov/projects/lls-addons"
  ],

Making it like that solved the issue.

@evmorov evmorov closed this as completed Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant