latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.55k stars 52 forks source link

Need some help setting up preview on windows #1169

Closed AB10110F closed 3 months ago

AB10110F commented 3 months ago

I'm using neovim with lspconfig on windows, I installed texlab and tectonic through mason and sioyek with scoop. I have Microsoft Visual C++ Redistributable for Visual Studio 2015 installed as well. I followed the wiki and my configuration is the following:


lspconfig.texlab.setup {
  settings = {
    texlab = {
      auxDirectory = ".",
      bibtexFormatter = "texlab",
      build = {
        executable = "tectonic",
        args = {
          "-X",
          "compile",
          "%f",
          "--synctex",
          "--keep-logs",
          "--keep-intermediates"
        },
        forwardSearchAfter = false,
        onSave = false
      },
      chktex = {
        onEdit = false,
        onOpenAndSave = false
      },
      diagnosticsDelay = 300,
      formatterLineLength = 80,
      forwardSearch = {
        executable = "sioyek",
        args = {
          "--reuse-window",
          "--execute-command",
          "toggle_synctex",
          "--inverse-search",
          "texlab inverse-search -i \"%%1\" -l %%2",
          "--forward-search-file",
          "%f",
          "--forward-search-line",
          "%l",
          "%p",
        }
      },
      latexFormatter = "latexindent",
      latexindent = {
        modifyLineBreaks = false
      }
    }
  }
}

The autocompletion works perfectly, but when I try to execute the command TexlabForward it just says Search Unconfigured. What am I missing?

pfoerster commented 3 months ago

@AB10110F It looks like the plugin is not passing the settings to the server. Does the build command run tectonic or does it still use latexmk? If latexmk is called, then the server has not received any configuration and is still using the default settings.

AB10110F commented 3 months ago

@pfoerster You were right it was not using tectonic. I was able to solve it by installing tectonic with scoop and putting the whole path of sioyek on the config:

executable = "C:\\Users\\WSwor\\scoop\\apps\\sioyek\\2.0.0\\sioyek",

thank you