latex-lsp / texlab

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

Sublime Text3 texlab service startup failed #253

Closed krisfans closed 3 years ago

krisfans commented 4 years ago

version information

Snipaste_2020-06-01_20-20-44 Snipaste_2020-06-01_20-20-25

LSP setting

{
    "clients":
    {
        "clangd":
        {
            "enabled": true
        },
        "pyls":
        {
            "enabled": true
        },
        "texlab": {
            "command": ["D:/Software/texlab-x86_64-windows/texlab.exe"],
            "enabled": true,
            "languages": [{
                "languageId": "latex",
                "scopes": ["text.tex.latex"],
                "syntaxes": ["Packages/LaTeX/LaTeX.sublime-syntax"]
            }, {
                "languageId": "bibtex",
                "scopes": ["text.bibtex"],
                "syntaxes": ["Packages/LaTeX/Bibtex.sublime-syntax"]
            }]
        }
    }
}
pfoerster commented 4 years ago

Thanks for the report. Can you try running texlab with -vvvv --log-file texlab.log and see if texlab produces a log file when starting the extension fails? This one is a bit difficult to debug, otherwise.

krisfans commented 4 years ago

I think I has found the reason . I shuold open a folder first then open a file , texlab can work. If I open a file separately ,texlab does not work. It's not convenient. But there is still a problem--completion does not support multi files.

D:\Myworkdata\Thesis\
├─.gitignore
├─indent.log
├─main.pdf
├─main.tex  
├─README.md
├─Thanks
├─Figures 
├─Chapter
    ├──chapter1
    ├──chapter2
    ├──chapter3
├─Bibliography
├─Abstract
├─.git

For example , if I want to insert a figure in chapter1, command \includegraphics{Figures/} does not show completion of files.

This is completion in main.tex NZeC6K.png

This is completion in chapter1.tex NZeU10.png

main.tex

% !TEX program = xelatex
\documentclass[a4paper,zihao=-4,UTF8]{ctexbook}
\usepackage{gbt7714}
\bibliographystyle{gbt7714-numerical} 
\begin{document}
\setlength\belowdisplayskip{10pt plus 1pt minus 1pt}
\setlength\abovedisplayskip{10pt plus 1pt minus 1pt}
\frontmatter
\input{Abstract/abstract}
\tableofcontents
\mainmatter
\input{Chapter/chapter1}
\input{Chapter/chapter2}
\input{Chapter/chapter3}
\input{Chapter/chapter4}
\input{Chapter/chapter5}
\backmatter
\input{Thanks/thanks}
\zihao{5}
\nocite{*}
\bibliography{Bibliography/ref.bib}
\end{document}

chapter1.tex

%! TEX root = ../main.tex
\chapter{a}
\begin{figure}[tb]
    \centering
    \includegraphics[]{Figures/}
    \caption{Caption here}
    \label{fig:figure1}
\end{figure}
...
krisfans commented 3 years ago

fixed in sublime text 4