Open ianchanning opened 5 years ago
Ouch, I have this too, and I still don't know how. Using NVim here.
@isthisnagee and I just spent too much time looking into this, and maybe figured something out!
We used :TagbarDebug
and discovered that the output of ctags
looks like this (a snippet):
regionsFolded /tmp/vOxOQei/10.js /^ const [regionsVisible, regionsFolded] = _.partition(regions, region =>$/;" C line:899
regionsToShow /tmp/vOxOQei/10.js /^ const regionsToShow = _.sortBy(regionsVisible, 'name');$/;" C line:902
foldedRegionNames /tmp/vOctags-og: Warning: ignoring null tag in /tmp/vOxOQei/10.js(line: 986)
xOQei/10.js /^ const foldedRegionNames = _.sortBy(regionsFolded, 'name').map($/;" C line:903
hasOverrides /tmp/vOxOQei/10.js /^ const hasOverrides =$/;" C line:988
allowSubmitWithOverrides /tmp/vOxOQei/10.js /^ const allowSubmitWithOverrides =$/;" C line:994
For the record, when I invoke ctags on certain js files, I get this warning (if you do not, I don't think you'll get any problems):
$ cat /tmp/foo.js
if (true) {
this[0] = function() {};
}
$ ctags -f - /tmp/foo.js
ctags: Warning: ignoring null tag in /tmp/foo.js(line: 2)
The problem seems to be that this invocation of system
in tagbar captures both stderr and stdout, and there are no guarantees about how they will get interleaved. Then, when we try to parse the ctags contents, it won't necessarily be a valid ctags file, and we crash in ProcessFile
.
Some ideas:
stderr
from the ctags
process to /dev/null
.I have this issue only when using universal-ctags this issue is not there when I switch back to exuberant ctags.
I'm using Vim 8.1 on Ubuntu 18.04
I get the following error every few seconds when viewing a javascript file. It is using various ES7 syntax constructs, so it could be that the tags are invalid.
I thought perhaps my tags were out of date so made sure they were up-to-date. Other files in the same directory with similar syntax show the tags ok.
On the very first opening of the file (after I close and reopen Vim) I get this error:
But after the first time I don't see that error again.
Debug info
My
:version
:I'm using Vundle and I have the following plugins installed: