Closed mrghosti3 closed 1 month ago
@mrghosti3 Can you create a log file using texlab -vvvv --log-file /path/to/texlab.log
please? It looks like the server and the editor have different understandings of the line/column to offset translation.
Here is the log: texlab.log
@mrghosti3 Thanks for the log file!
This looks oddly similar to https://github.com/neovim/neovim/issues/27383.
Input file:
0 \usepackage[unicode,colorlinks=false]{hyperref}
1 \usepackage[utf8x]{inputenc}
2 \usepackage[L7x]{fontenc}
...
102 }{\end{list}\end{mdframed}\par}
103
Change notification:
{
"contentChanges": [
{
"range": {
"end": { "character": 0, "line": 104 },
"start": { "character": 0, "line": 103 }
},
"text": "",
"rangeLength": 1
}
],
"textDocument": {
"version": 8,
"uri": "file:///ddisk/uni/coding/ReportAndSlideTemplates/Examples/allPacks.tex"
}
}
The start position is located after last character of the document (the final newline), the end position on the line below it (but this does not exist). This seems wrong. In my opinion, it should be the last character of line 102 to the first character of line 103 instead so that the change deletes the last newline between line 102 and line 103 (there is no line 104 in this document).
Indeed it does look like it could be an issue on the editor side. Though would be good to get someones feedback from a different editor, just in case. Perhaps this issue could remain open until there's an update on the one you mentioned?
Please test https://github.com/neovim/neovim/pull/29904
@tomtomjhj sorry for the late response.
It seems to be fixed and texlab doesn't crash anymore.
Environment
Description
To get this error, follow these steps:
This doesn't seem like a editor specific error, but could be wrong so more testing from others would be appreciated.
Backtrace:
More detailed backtrace in text file: trace.log
Did some minor investigation and the issue lies here:
https://github.com/latex-lsp/texlab/blob/8a66d053e498c217acda9f238993ac4973c69036/crates/texlab/src/server.rs#L384-L387
Though from the backtrace, it is unclear where the problem comes into existence:
https://github.com/latex-lsp/texlab/blob/8a66d053e498c217acda9f238993ac4973c69036/crates/texlab/src/util/line_index_ext.rs#L26-L30