Closed Andrew15-5 closed 1 year ago
Thank you for your report. Do you have tested with the lasted texlab with that fix patch?
Yes, of course. Just git clone
, cd
, cargo build
and mv texlab /path/to/bin dir/
. Works like a charm.
Updated the comment:
\newcommand{}
problemVery detailed reproduce steps, will follow up on this issue.
@fannheyward It looks like all of the tests are bugs in the server and not in coc-texlab
.
@Andrew15-5 Can you try out the latest changes on the texlab
master branch, please? The tests should pass now :)
But now there are some bugs with coc-texlab (I'm pretty sure)
Yay, I'm glad I put this I'm pretty sure
.
@pfoerster, let me "transfer" the issue to https://github.com/latex-lsp/texlab, and then we can talk tests. ;)
Issue https://github.com/latex-lsp/texlab/issues/857 (https://github.com/fannheyward/coc-texlab/issues/249) has been resolved and server now provides suggestions with any macro names, hurray! But now there are some bugs with coc-texlab (I'm pretty sure). Below I paste Neovim config, LaTeX file/document and some tests. Only the 3rd test is passed because macro/command name consists of non-special characters (
[a-z]
). But of course ideally all 7 must be passed (support of 99% any name).There are some notes:
lualatex
command (it tolerates/supports a lot more macro names thanpdflatex
)[0-9]
) as a 1st character, then the compiler error will occur if one of them is used and won't occur if none of them is used{}
to the 1st argument of\newcommand
macro (the correct form) will trigger an extension error for some Unicode macro names (I don't know what are the rules for triggering the error)<C-Space>
), without it tests that require pasting from clipboard wouldn't work (see https://github.com/neoclide/coc.nvim/issues/4568)suggest.asciiMatch
(:CocCofig
) isn't set tofalse
then tests for which you have to paste non-ASCII text from clipboard wouldn't workinit.vim
```vim call plug#begin($HOME . '/.config/nvim/autoload/plugged') Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'joshdick/onedark.vim' Plug 'tpope/vim-commentary' call plug#end() colorscheme onedark " Comment lines noremapbug.tex
```latex \documentclass{article} % \newcommand{\ö}{} % No error % \newcommand{\öö}{} % Error: Unexpected "}" (texlab 1) % \newcommand{\ööabc}{} % Error: Unexpected "}" (texlab 1) \newcommand\ööabc{} \def\öabc{} \def\123{123} \def\abc{} \begin{document} \end{document} ```Tests
Step 0: `\`, `\newcommand{}
Meaningless errors are shown which say that the `}` character is inserted in the unexpected/wrong place, but the syntax is correct. Maybe it's only shown when the macro's name have anything appended after the Unicode character (a hunch from just looking at the places where the errors occur). ![image](https://user-images.githubusercontent.com/37143421/224190462-2e6af06c-2ba3-4408-892b-af9218b9b29d.png) ![image](https://user-images.githubusercontent.com/37143421/224190515-5d36cf47-00c1-40da-8a97-64281a5124a4.png) Output (from `lualatex bug.tex`): ![image](https://user-images.githubusercontent.com/37143421/224190741-8098910b-3ac1-4654-adcd-6f5ad55f59a6.png) Source code: ```latex \documentclass{article} \newcommand{\ö}{ö} % No error \newcommand{\öö}{öö} % Error: Unexpected "}" (texlab 1) \newcommand{\ööabc}{ööabc} % Error: Unexpected "}" (texlab 1) \renewcommand\ööabc{ööabc} % No error \def\öabc{öabc} \def\123{123} \def\abc{abc} \def\a0{a0} \def\0a{0a} % \def\1a{1a} % OK if no macro starting with \1 is used \begin{document} \ö, \öö, \ööabc, \öabc, \123, \abc, \a0, \0a \end{document} ```Updated test results (checked means no issues):
\newcommand{...}
(fixed)Update: main conversation/issue is now here: https://github.com/latex-lsp/texlab/issues/864. This issue will be closed with the main issue because the issue is related to both projects.