Josef-Friedrich / vscode_LuaTeX_Lua-API

Visual Studio Code extension for the LuaTeX development
https://marketplace.visualstudio.com/items?itemName=JosefFriedrich.luatex
GNU General Public License v2.0
3 stars 0 forks source link

VSCode not finding symbols for tex API #1

Closed mtlaurentys closed 2 weeks ago

mtlaurentys commented 1 month ago

I have the following extensions installed:

However, when I open a lua file, anywhere I use the tex object, I get syntax warnings. When hovering, it reads: Undefined global 'tex'. Lua Diagnostics.(undefined-global)

Here is my settings.json:

{
    "window.zoomLevel": 3,
    "git.openRepositoryInParentFolders": "never",
    "latex-workshop.latex.recipe.default": "lastUsed",
    "latex-workshop.latex.recipes": [
        {
            "name": "lualatex->biber->lualatex",
            "tools": [
                "lualatex"
            ]
        },
    ],
    "latex-workshop.latex.tools": [
        {
            "name": "lualatex",
            "command": "lualatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "%DOC%"
            ]
        }
    ],
    "luatex.library": ["all", "luatex", "luametatex", "lualatex", "lualibs", "luaotfload"]
}

I expected that after adding the setting.json libraries it would work right away. I have tried closing and opening, but haven't went far on debugging this, as there are no other installation instructions.

Josef-Friedrich commented 1 month ago

Thank you for reporting this issue. I can't get the addon to run now either ... I can't find out the cause right now. something must have changed.

Josef-Friedrich commented 1 month ago

In the meantime you can use the Addon manager of the Lua Language Server. All LuaTeX related libraries are included:

Addon-Manager

Josef-Friedrich commented 1 month ago

Or you clone the libraries

git clone https://github.com/Josef-Friedrich/LuaTeX_Lua-API.git <repo>

.vscode/settings.json:

{
"Lua.workspace.library": [
    "<repo>/library"
  ]
}
mtlaurentys commented 2 weeks ago

Hey, sorry for the late follow-up

Both your alternative and your fix worked as expected for me. Thank you for the support!