abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
384 stars 46 forks source link

Issue with Emacs 26 #473

Closed noxdafox closed 6 years ago

noxdafox commented 6 years ago

Greetings,

I was trying out Emacs 26 from Debian shanpshots and I get a very lengthy error as soon as I activate ycmd-mode.

Error sending BufferVisit request: (wrong-type-argument request-response #s(request-response 200 nil nil nil success http://127.0.0.1:34535/event_notification t (:type POST :params nil :data {"event_name":"BufferVisit","file_data":{"/home/noxdafox/test.py":{"contents":"print(\"Hello World\")\n","filetypes":["python"]}},"filepath":"/home/noxdafox/test.py","line_num":1,"column_num":1} :parser #[0 \301\302 )\207 [json-array-type list json-read] 1] :headers ((Content-Type . application/json) (X-Ycm-Hmac . d8GPR0Imv8t6+8co/8+r/dla43cYFgEdTVT7dM0BqY8=)) :complete #[128 \302\300\303\301""\207 [(closure ((d . #s(deferred identity deferred:default-errorback deferred:default-cancel #s(deferred #[257 \301!\203\0\211G\302Y\203\0\211\303H>\204\0\304\305\306D"\210\211\307H\310\311"\210\211\207 [cl-struct-request-response-tags vectorp 14 0 signal wrong-type-argument request-response 3 ycmd--log-content HTTP RESPONSE CONTENT] 5 

(fn RESPONSE)] deferred:default-errorback deferred:default-cancel #s(deferred deferred:default-callback #[257 \301\302\300#\210\303\304!\210\305\207 [BufferVisit message Error sending %s request: %s ycmd--report-status errored nil] 5 

(fn ERR)] deferred:default-cancel #s(deferred #[257 \300\203@\0r\300q\210\302!\203;\0\211\303\304\236A\236A\305\304\236A\236A\306\236A\307\230\203-\0\310!\2024\0\306\311#\210\312\266\203\262\202>\0\313\211)\207\302!\203o\0\211\303\304\236A\236A\305\304\236A\236A\306\236A\307\230\203e\0\310!\202l\0\306\311#\210\312\266\203\207\313\211\207 [test.py ycmd--buffer-visit-flag ycmd--exception-p TYPE exception extra_conf_file message UnknownExtraConf ycmd--handle-extra-conf-exception %s: %s nil t] 9 

(fn RESPONSE)] deferred:default-errorback deferred:default-cancel #s(deferred #[0 r\300q\210\302 \211   \232?\205\0\211\303 \262)\207 [test.py ycmd--last-modified-tick buffer-chars-modified-tick ycmd-notify-file-ready-to-parse] 3] deferred:default-errorback deferred:default-cancel nil nil nil) nil nil) nil nil) nil nil) nil nil)) (args :type POST :params nil :data {"event_name":"BufferVisit","file_data":{"/home/noxdafox/test.py":{"contents":"print(\"Hello World\")\n","filetypes":["python"]}},"filepath":"/home/noxdafox/test.py","line_num":1,"column_num":1} :parser #[0 \301\302 )\207 [json-array-type list json-read] 1] :headers ((Content-Type . application/json) (X-Ycm-Hmac . d8GPR0Imv8t6+8co/8+r/dla43cYFgEdTVT7dM0BqY8=)) :complete #3) (url . http://127.0.0.1:34535/event_notification) t) (d &rest args) (deferred:callback-post d (plist-get args :response))) (#s(deferred identity deferred:default-errorback deferred:default-cancel #s(deferred #[257 \301!\203\0\211G\302Y\203\0\211\303H>\204\0\304\305\306D"\210\211\307H\310\311"\210\211\207 [cl-struct-request-response-tags vectorp 14 0 signal wrong-type-argument request-response 3 ycmd--log-content HTTP RESPONSE CONTENT] 5 

(fn RESPONSE)] deferred:default-errorback deferred:default-cancel #s(deferred deferred:default-callback #[257 \301\302\300#\210\303\304!\210\305\207 [BufferVisit message Error sending %s request: %s ycmd--report-status errored nil] 5 

(fn ERR)] deferred:default-cancel #s(deferred #[257 \300\203@\0r\300q\210\302!\203;\0\211\303\304\236A\236A\305\304\236A\236A\306\236A\307\230\203-\0\310!\2024\0\306\311#\210\312\266\203\262\202>\0\313\211)\207\302!\203o\0\211\303\304\236A\236A\305\304\236A\236A\306\236A\307\230\203e\0\310!\202l\0\306\311#\210\312\266\203\207\313\211\207 [test.py ycmd--buffer-visit-flag ycmd--exception-p TYPE exception extra_conf_file message UnknownExtraConf ycmd--handle-extra-conf-exception %s: %s nil t] 9 

(fn RESPONSE)] deferred:default-errorback deferred:default-cancel #s(deferred #[0 r\300q\210\302 \211   \232?\205\0\211\303 \262)\207 [test.py ycmd--last-modified-tick buffer-chars-modified-tick ycmd-notify-file-ready-to-parse] 3] deferred:default-errorback deferred:default-cancel nil nil nil) nil nil) nil nil) nil nil) nil nil)) apply append] 6 

(fn &rest ARGS2)] :error #[128 \302\300\303\301""\207 [request-default-error-callback (http://127.0.0.1:34535/event_notification) apply append] 6 

(fn &rest ARGS2)] :url http://127.0.0.1:34535/event_notification :response #1) #<killed buffer> HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json
Date: Sun, 24 Jun 2018 16:38:26 GMT
Server: waitress
X-Ycm-Hmac: vZn9GAJpO3a/a+onF+H4Y77nOAB6md9eN8uen/4PUx4=
 nil curl (/tmp/emacs-requestiej2HS)))

This repeats on every request against the YCMD server. The server logs do not show any error.

ycmd and emacs-ycmd are both up-to-date.

My init.el.

(require 'ycmd)
(add-hook 'after-init-hook #'global-ycmd-mode)
(set-variable 'ycmd-python-binary-path "/usr/bin/python3")
(set-variable 'ycmd-server-command
              '("python3" "/home/noxdafox/development/ycmd/ycmd"))
(set-variable 'ycmd-global-config
              "/home/noxdafox/.emacs.d/ycmd_global_config.py")

(require 'company-ycmd)
(company-ycmd-setup)

(require 'company)
(global-company-mode t)
(set 'company-idle-delay 0.1)
(require 'company-childframe)
(company-childframe-mode 1)
noxdafox commented 6 years ago

Reverting to Emacs 25 "fixes" the issue.

abingham commented 6 years ago

Hmmm. It definitely works with Emacs 26 for me, but let me poke at it a bit and see what the problem might be. What versions of request and request-deferred are you using?

noxdafox commented 6 years ago

request: 20170131.1747 request-deferred: 20160419.1605

abingham commented 6 years ago

Those are the versions I'm using, and everything seems to work for me on 26. I'm grasping at straws here, but could you clean out all of your .elc files before running 26?

abingham commented 6 years ago

FWIW, I just went through a 25->26 transition on one of my machines. I was initially seeing the same problem as you, but after clearing out my elpa directory everything (well, ycmd at least) seems to work.

noxdafox commented 6 years ago

I suspect it's something similar, I will try tonight and let you know.

noxdafox commented 6 years ago

Indeed it was the case. Removing all .elc files fixed the issue.

Do you know if there's a way I can do it via elpa or Emacs? Some command to clear the binary of the packages?

abingham commented 6 years ago

Hmmm, not sure about that. There's byte-recompile-directory, but I'm not sure if that will know that an elc is out of date due to a version upgrade.

On Thu, Jul 12, 2018 at 10:03 PM Matteo Cafasso notifications@github.com wrote:

Indeed it was the case. Removing all .elc files fixed the issue.

Do you know if there's a way I can do it via elpa or Emacs? Some command to clear the binary of the packages?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/abingham/emacs-ycmd/issues/473#issuecomment-404633546, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE1eJd07n4L9r5Rsrdpfk6lbOleV2G-ks5uF6uEgaJpZM4U1N_8 .