copy / deoplete-ocaml Goto Github PK
View Code? Open in Web Editor NEWAsynchronous completion for OCaml in vim or neovim
License: BSD 2-Clause "Simplified" License
Asynchronous completion for OCaml in vim or neovim
License: BSD 2-Clause "Simplified" License
Maybe I'm doing something wrong, but deoplete shows completion suggestions all the time, not after typing 2 characters as it should. That is I get completion suggestions even after pressing spacebar or creating new line.
I'm using Neovim 2.3 dev.
Thank you for making great plugin!
I use vim8 on macos and debian(using windows subsystem linux).
On mac, I can use completion but on debian cannot.
In line 134 I find "output" is bytes but str.
I assume that it causes this trouble.
if "output" is decoded utf-8, It works.
Is it apropriate?
So, if I open a file with these contents,
open Core
let () =
print_string "Hello, world!"
… position my cursor on the last line, number 4
, and then press o
to start a new line, I immediately get all of these deoplete messages:
(Yes, each message is echoed twice — I have no idea why?)
[deoplete] Traceback (most recent call last):
[deoplete] Traceback (most recent call last):
[deoplete] File "/Users/ec/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/omni.py", line 73, in _get_complete_position
[deoplete] File "/Users/ec/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/omni.py", line 73, in _get_complete_position
[deoplete] complete_pos = self.vim.call(self.__omnifunc, 1, '')
[deoplete] complete_pos = self.vim.call(self.__omnifunc, 1, '')
[deoplete] File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 229, in call
[deoplete] File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 229, in call
[deoplete] return self.request('nvim_call_function', name, args, **kwargs)
[deoplete] return self.request('nvim_call_function', name, args, **kwargs)
[deoplete] File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 130, in request
[deoplete] File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 130, in request
[deoplete] res = self._session.request(name, *args, **kwargs)
[deoplete] res = self._session.request(name, *args, **kwargs)
[deoplete] File "/usr/local/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 97, in request
[deoplete] File "/usr/local/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 97, in request
[deoplete] raise self.error_wrapper(err)
[deoplete] raise self.error_wrapper(err)
[deoplete] neovim.api.nvim.NvimError: b'Vim(return):E716: Key not present in Dictionary: complete_position'
[deoplete] neovim.api.nvim.NvimError: b'Vim(return):E716: Key not present in Dictionary: complete_position'
[deoplete] Error occurred calling omnifunction: deoplete#mapping#_completefunc. Use :messages for error details.
[deoplete] Error occurred calling omnifunction: deoplete#mapping#_completefunc. Use :messages for error details.
The relevant part seems to be the neovim.api.nvim.NvimError: b'Vim(return):E716: Key not present in Dictionary: complete_position'
; although I can't, for the life of me, figure out where that error is actually occurring.
The error doesn't occur when using Merlin's merlin#Complete
as omnifunc
, with Deoplete and deoplete-ocaml
disabled (i.e. hit o
as described above, then hit <C-x><C-o>
.) Meanwhile, with Deoplete and deoplete-ocaml
enabled, it works fine if I remove the open Core
line. As far as I can tell, it's only the combination of deoplete-ocaml
, a new blank line, and open Core
, that produces the error.
At this moment, I put this deoplete_ocaml.py
file in ~/.cache/dein/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete
~/.c/d/r/g/S/d/r/p/deoplete (master|…) $ ls
__init__.py deoplete.py deoplete_ocaml.py exceptions.py filter
I was wondering if maybe this is the right way to install, and how may I update this plugin automatically in future?
I'm not sure if this is intended or if there's something missing on my setup. As it seems like no crashes are happening, I'm not sure how to fix this on my own, so I'm opening an issue.
I've enabled the DEBUG flag and put some debug messages of my own in the code.
I can see that no exception is happening, the list of candidates is just coming back empty.
I can also see that the query is being recognized correctly and the request is going through.
/tmp/deoplete-ocaml-context.log
'cwd': '/home/joaopaulo/ocaml/hello-ocaml',
'encoding': 'utf-8',
'event': 'TextChangedI',
'filetype': 'ocaml',
'filetypes': ['ocaml'],
'ignorecase': 1,
'input': ' LTerm.',
'is_async': False,
'is_refresh': True,
'is_windows': 0,
'keyword_pattern': '[a-zA-Z_][\\w@0-9_À-ÿ]*',
'next_input': '',
'position': [0, 6, 9, 0],
'rpc': 'deoplete_auto_completion_begin',
'same_filetypes': [],
Moreover, top-level completions work well, but nested ones (after the dot) don't come through.
[{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LargeFile'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lazy'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lexing'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'List'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'ListLabels'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_resources'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_edit'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_windows'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_event'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_history'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_dlist'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_buttons_impl'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_running_impl'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_toplevel_impl'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_key'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_inputrc'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_containers_impl'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_read_line'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_geom'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_resource_lexer'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_widget_base_impl'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_unix'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_widget'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_draw'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_style'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_mouse'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_text'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_ui'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_widget_callbacks'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_color_mappings'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'LTerm_scroll_impl'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_mutex'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_switch'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_pqueue'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_mvar'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_result'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_list'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_sequence'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_stream'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_pool'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_condition'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_engine'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_main'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_fmt'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_unix'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_gc'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_sys'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_bytes'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_process'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_config'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_io'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_timeout'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_throttle'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_unix_jobs'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_preemptive'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_daemon'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_log'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_log_rules'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_log_core'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lwt_react'},
{'desc': '', 'info': '', 'kind': 'Module', 'name': 'Lib'}]
'input': ' LTerm.'
[]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.