Comments (8)
You can add this config:
let g:completor_filetype_map = {'python.django': 'python'}
from completor.vim.
Here is way to debug python completion:
Run:
python3 /path/to/completor.vim/pythonx/completers/python/python_jedi.py -v
then copy the following as the input to python_jedi.py:
{"filename": "/home/vagrant/test.py", "line": 1, "col": 3, "content": "import os\nos."}
then press enter
to see if there has any results.
If the results is []
then open the following file to see the logs:
/path/to/completor.vim/pythonx/completers/completor.log
from completor.vim.
The result is a really long list of dicts. Should it be working then?
And is it normal that I get a lot of [ID] results with Completor/Jedi? I have used YCM before and it seemed to limit the results a lot more, giving more accurate suggestions and being more aware of class attributes. Using self.
with YCM gives the class attributes/functions and parent class attributes/functions but completor doesn't. AFAIK YCM also uses Jedi, so the results should be same with YCM and completor.
Also, if I try "something".up
, completor only suggests my Django UpdateView snippet from UltiSnip. YCM suggests: upper function: __builtin__.str.upper
and isupper function: __builtin__.str.isupper
.
The log content:
2017-02-07 09:41:50,964 [INFO][python_jedi] {"filename": "/home/vagrant/test.py", "line": 1, "col": 3, "content": "import os\nos."}
from completor.vim.
Completor also suggests what YCM suggests:
Maybe you have completor.vim and YCM both installed. They can not work together.
from completor.vim.
Ok found the problem. I had autocmd Filetype python set ft=python.django
. Commenting that one out made completor.vim work.
Still, my results look a bit different to yours:
Why could this be? I tried removing all other plugins and cleared my .vimrc but no luck.
from completor.vim.
Unrelated. @maralla how do you have the documetation pop-up while completing? Do you use a combination of plugins? Would love to see your python dev setup. Thanks :)
from completor.vim.
Just faced this problem and figured out with @maralla 's debugging tutorial. I was trying to install completor plugin as a system default for all users on a Linux box (installed to a subdirectory in /etc/vim
), and completor would like to write to a log file in the plugin directory, which is obviously impossible because normal users have no permission to write to /etc/vim
.
vim-plug
seems to provide an option named dir
for plugins, I wonder if completor could use that directory to store log files instead?
Update: python_jedi seems to be the only completer with this issue.
Update 2: please ignore my previous advice of using dir
option of vim-plug
to determine the log file location, I misunderstood the use of that option.
from completor.vim.
About @decent1 problem,
I find convenient to set autocmd Filetype python set ft=python.django
in my local vimrc for django projects, also because ultisnips will load the django snippets. Many other plugins (I think) work by matching with regexp, or perhaps dot separated words the filetype, in other words, I would expect to have python semantic completion available with a filetype which is python.django
.
I've currenlty forced this behavior editing the pythonx/completor/__init__.py
file, and adding a map item
_type_map = {
b'c': b'cpp',
b'python.django': b'python',
b'javascript.jsx': b'javascript'
}
at line72.
@maralla is there a better way to support this behavior?
Thanks for this great plugin!
from completor.vim.
Related Issues (20)
- A source for ctags?
- the fallback completer: complete form the current buffer, not from all buffers? HOT 1
- Integrate ALE completion HOT 2
- LanguageServer.jl LSP support
- Just show the function arguments over it with Jedi HOT 1
- 能否改进一下候选项的顺序
- The completed word is inserted in the wrong position, if a german umlaut is present in the current line.
- can I use pyls with completor.vim ?! HOT 1
- self.ident is HOT 1
- start_column() doen't work for non english words
- using arrow keys instead of ctrl+n
- 中文补全时会吞掉标点之前的部分字符 HOT 1
- Tweaking LSP trigger accordingly
- Validator requires vim compiled with python or python3 and has features `job`, `timers` and `lambda` HOT 1
- iskeyword option
- Getting completion for R programming
- Cannot get to work on msys2
- Placeholders for function arguments - integration with CompleteParameter.vim HOT 2
- Any updates so far, generally speaking?
- How to log an LSP output without the use of `let g:completor_debug = 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 completor.vim.