Giter Club home page Giter Club logo

Comments (8)

maralla avatar maralla commented on July 24, 2024 1

You can add this config:

let g:completor_filetype_map = {'python.django': 'python'}

from completor.vim.

maralla avatar maralla commented on July 24, 2024

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.

akifd avatar akifd commented on July 24, 2024

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.

maralla avatar maralla commented on July 24, 2024

Completor also suggests what YCM suggests:

com

Maybe you have completor.vim and YCM both installed. They can not work together.

from completor.vim.

akifd avatar akifd commented on July 24, 2024

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:

completor

Why could this be? I tried removing all other plugins and cleared my .vimrc but no luck.

from completor.vim.

ninjawithaneedle avatar ninjawithaneedle commented on July 24, 2024

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.

JokerQyou avatar JokerQyou commented on July 24, 2024

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.

abidibo avatar abidibo commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.