Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vista fails on c++ file #82

Closed
kchibisov opened this issue May 14, 2019 · 11 comments
Closed

Vista fails on c++ file #82

kchibisov opened this issue May 14, 2019 · 11 comments

Comments

@kchibisov
Copy link

vista fails with:

Error detected while processing function <SNR>131_on_exit[6]..<SNR>131_ApplyExtracted[14]..vista#viewer#Display[1]..<SNR>137_Render[2]..vista#ren
derer#default#Render[5]..<SNR>139_Render[25]..<SNR>139_RenderDescendants[44]..<SNR>139_RenderDescendants[41]..<SNR>139_DescendantsOf:
line    1:
E874: (NFA) Could not pop the stack!

OS: Arch Linux.
Output of ctags --version

Universal Ctags 0.0.0(45968eff), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Oct 15 2018, 21:55:11
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml

neovim version

NVIM v0.3.5
Build type: Release
LuaJIT 2.0.5

vista version: 0e3e3a60f5d657f24a787472e4dbc7a7a706b4d6

File for reproduction ( convert to .h )
SmallVector.txt

Vista info


    Current FileType: cpp
Avaliable Executives: ['ctags', 'lcn']
    Global Variables:
    let g:vista#executive#ctags#support_json_format = 1
    let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
    let g:vista#render#ctags = 'default'
    let g:vista#renderer#ctags = 'default'
    let g:vista#renderer#default#vlnum_offset = 3
    let g:vista#renderer#enable_icon = 1
    let g:vista#renderer#icons = {'subroutine': '洛', 'method': '', 'func': '', 'variables': '', 'namespace': '', 'field': '綠', 'interface':
 '禍', 'type': '', 'packages': '', 'property': '襁', 'implementation': '', 'default': '', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'c
onst': '', 'macros': '', 'map': 'פּ', 'fields': '綠', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typedef': '', 'variable':
 '', 'modules': '', 'constant': '', 'struct': 'פּ', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member':
'', 'var': '', 'union': '鬒'}
    let g:vista_cursor_delay = 0
    let g:vista_sidebar_width = 35
    let g:vista_stay_on_open = 0

Steps to reproduce given the above info

nvim SmallVector.h
:Vista

Expected behavior
Show tags

Actual behavior
Error

@liuchengxu
Copy link
Owner

I can't reproduce with this minimal vimrc:

call plug#begin('~/.vim/plugged')
Plug 'liuchengxu/vista.vim'
call plug#end()

let g:vista#executive#ctags#support_json_format = 1
let g:vista#executives = ['coc', 'ctags', 'lcn', 'vim_lsp']
let g:vista#render#ctags = 'default'
let g:vista#renderer#ctags = 'default'
let g:vista#renderer#default#vlnum_offset = 3
let g:vista#renderer#enable_icon = 1
let g:vista#renderer#icons = {'subroutine': '', 'method': '', 'func': '', 'variables': '', 'namespace': '', 'field': '', 'interface': '', 'type': '', 'packages': '', 'property': '', 'implementation': '', 'default': '', 'augroup': '', 'macro': '', 'enumerator': '', 'const': '', 'macros': '', 'map': '', 'fields': '', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typedef': '', 'variable': '', 'modules': '', 'constant': '', 'struct': '', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member': '', 'var': '', 'union': ''}
let g:vista_cursor_delay = 0
let g:vista_sidebar_width = 35
let g:vista_stay_on_open = 0

You have to see whether some other plugins result in your issue.

屏幕快照 2019-05-14 上午9 41 55

@kchibisov
Copy link
Author

For me it doesn't work with your init.vim file either. Maybe some ctags related problem?
Screenshot-Tue_14_May_2019_47

@liuchengxu
Copy link
Owner

I'm not sure if it's a problem of neovim. Try updating your neovim? Here is my neovim version:

:version
NVIM v0.4.0-dev
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Ws
trict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_
GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20190510-20306-l8yquw/build/config -I/tmp/neovim-20190510-20306-l8yquw/src -I/usr/local/include -I/usr/local
/opt/gettext/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/tmp/neovim-20190510-20306-l8yquw/build/src/nvim/auto -I/tmp/neovim-20190510-20306-l8yquw/bu
ild/include
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-a541c68/share/nvim"

@kchibisov
Copy link
Author

Same error with ( neovim was built from git )

NVIM v0.4.0-758-g9e0982a1a
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=native -O2 -pipe -fno-plt -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-
color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/kchibisov/Applications/neovim-git/src/neovim-git/build/config -I/home/kchibisov/Applications/neovim-git/src/neovim-git/src -I/usr/include -I/home/kchibisov
/Applications/neovim-git/src/neovim-git/build/src/nvim/auto -I/home/kchibisov/Applications/neovim-git/src/neovim-git/build/include
Compiled by kchibisov@NightLord

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

@liuchengxu
Copy link
Owner

liuchengxu commented May 14, 2019

Does this error only occur in the cpp/.h file or apply everywhere? Does it happen in vim?

@kchibisov
Copy link
Author

Only some cpp files. Everything is fine on this file with Vista lcn. What's your ctags --version?

@liuchengxu
Copy link
Owner

Universal Ctags 0.0.0(46490ea3), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Apr 17 2019, 09:48:50
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +case-insensitive-filenames, +packcc

That's really weird. I'm not familiar with E874. I can't help if I am not able to reproduce it.

@kchibisov
Copy link
Author

kchibisov commented May 14, 2019

I've figured output pattern to brake this. It fails on c++ destructors. So this example can be used instead.

class Foo {
  ~Foo() {
  }
};

How vista invokes ctags (which cli arguments)? So we can compare our output.
Edit: Updating ctags to latest master doesn't resolve the issue. Now it's really something strange.

@kchibisov
Copy link
Author

set re=1 resolves the issue.

@liuchengxu
Copy link
Owner

Glad to see it's resolved.

@hiberabyss
Copy link

Having the same problem.

In some cpp files, missing function items in vista window, while there are corresponding functions in the tag file after execute ctags command:

ctags --format=2 --excmd=pattern --fields=nksSaf --extras= --file-scope=yes --sort=no --append=no --language-force=c++ --c++-kinds=psvcdefghtmnu --output-format=json --fields=-PF -f- /var/folders/cj/lm7l170n62s19lnxb7h544h40000gn/T/2dc39a6ecb8b4a8d19b3bde54953b9df95f717cdac10d9a4c9b6cca6661ed0ad.cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants