Comments (3)
after modify def raise_ex()
to class raise_ex()
, it can raise the right log, it's abnormal by use let g:ncm2#matcher = 'substrfuzzy'
, if I use default matcher, it work fine.
diff --git a/pythonx/ncm2_pyclang_proc.py b/pythonx/ncm2_pyclang_proc.py
index d25eaee..fce4ad6 100644
--- a/pythonx/ncm2_pyclang_proc.py
+++ b/pythonx/ncm2_pyclang_proc.py
@@ -69,7 +69,7 @@ class Source(Ncm2Source):
except Exception as ex:
from neovim import Nvim
nvim = self.nvim # type: Nvim
- def raise_ex():
+ class raise_ex():
raise ex
nvim.async_call(raise_ex)
finally:
[ncm2_pyclang_proc@yarp] Exception in thread Thread-1:
[ncm2_pyclang_proc@yarp] Traceback (most recent call last):
[ncm2_pyclang_proc@yarp] File "/home/fcying/.pyenv/versions/3.6-dev/lib/python3.6/threading.py", line 916, in _bootstrap_inner
[ncm2_pyclang_proc@yarp] self.run()
[ncm2_pyclang_proc@yarp] File "/home/fcying/.pyenv/versions/3.6-dev/lib/python3.6/threading.py", line 864, in run
[ncm2_pyclang_proc@yarp] self._target(*self._args, **self._kwargs)
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2-pyclang/pythonx/ncm2_pyclang_proc.py", line 72, in worker_loop
[ncm2_pyclang_proc@yarp] class raise_ex():
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2-pyclang/pythonx/ncm2_pyclang_proc.py", line 73, in raise_ex
[ncm2_pyclang_proc@yarp] raise ex
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2-pyclang/pythonx/ncm2_pyclang_proc.py", line 65, in worker_loop
[ncm2_pyclang_proc@yarp] task()
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2-pyclang/pythonx/ncm2_pyclang_proc.py", line 333, in <lambda>
[ncm2_pyclang_proc@yarp] lambda: self.on_complete_task(context, data, lines)])
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2-pyclang/pythonx/ncm2_pyclang_proc.py", line 395, in on_complete_task
[ncm2_pyclang_proc@yarp] if not matcher(base, item):
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2/pythonx/ncm2_matcher/substrfuzzy.py", line 100, in match
[ncm2_pyclang_proc@yarp] hl = fuzzy_match(b, m[key], chcmp)
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2/pythonx/ncm2_matcher/substrfuzzy.py", line 18, in fuzzy_match
[ncm2_pyclang_proc@yarp] return substr_fuzzy_match(b, s, abbrs, chcmp)
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2/pythonx/ncm2_matcher/substrfuzzy.py", line 54, in substr_fuzzy_match
[ncm2_pyclang_proc@yarp] start = abbrs[0]
[ncm2_pyclang_proc@yarp] IndexError: list index out of range
from ncm2-pyclang.
[ncm2_pyclang_proc@yarp] Traceback (most recent call last):
[ncm2_pyclang_proc@yarp] File "/home/fcying/.vim/plugged/ncm2-pyclang/pythonx/ncm2_pyclang_proc.py", line 73, in raise_ex
[ncm2_pyclang_proc@yarp] raise ex
[ncm2_pyclang_proc@yarp] TypeError: exceptions must derive from BaseException
after modify def raise_ex() to class raise_ex(), it can raise the right log
Why ?
from ncm2-pyclang.
https://www.cnblogs.com/bidepanpan/p/7115153.html
TypeError: exceptions must derive from BaseException
异常必须从基础异常类中派生。然后看了下自己的第一行。用的是def,这是创建了一个方法。。而不是一个类,简单的语法错误。只要将第一行的def改成class
from ncm2-pyclang.
Related Issues (20)
- Variable members are not displayed when using clangd 6 HOT 4
- [TODO] try cpp implementation, compare features, performance
- [TODO] better argument parsing
- can't complete if work_dir not same with .clang_complete dir
- goto-declaration does not work HOT 1
- include file completion dosen't work
- [TODO] more flexible compile arguments config, maybe with some python? HOT 3
- Non-relative/-absolute includes are ignored HOT 5
- Code completion for CUDA files HOT 2
- Goto in a new split HOT 2
- Behavior when using auto HOT 3
- How to hide certain macros?
- Job is dead: FileNotFoundError HOT 16
- [ncm2_pyclang_proc@yarp] Job is dead. HOT 5
- support `platformio.ini`
- Return types seem to be entirely missing. HOT 1
- [TODO] improve neovim quit time
- [TODO] do not create tu for header file if we could find existing tu including the header
- [TODO] support clang_getCompletionFixIt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ncm2-pyclang.