Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
901 stars 98 forks source link

Something wrong when competing header names. #509

Open Spdwal opened 5 years ago

Spdwal commented 5 years ago

Hi, First of all, I really appreciate your greate work. I've used the irony-mode to complete my C++ work. But today I've got a bug when it is completing the header name. First the irony-mode complete a marked region: header.

#include <header>

And when I wrote 'algorithms' to complete the header file name.

#include<a>

It cause a bug.

Debugger entered--Lisp error: (args-out-of-range #<buffer test.cpp> 31 37)
  buffer-substring-no-properties(31 37)
  irony-eldoc--callback(("header" 31 37) nil #f(compiled-function () #<bytecode 0x41a6c4b9>))
  #f(compiled-function (candidates) #<bytecode 0x44f0b11d>)(nil)
  #f(compiled-function (candidates-result) #<bytecode 0x44f0fee5>)(#s(irony-iotask-result :-tag value :-value nil :-error nil :-error-data nil))
  irony-iotask-ectx-call-callback(#s(irony-iotask-ectx :started t :packaged-task #s(irony-iotask-packaged-task :task (:start (lambda (prefix style) (irony--server-send-command "candidates" prefix (cl-case style (case-insensitive "case-insensitive") (smart-case "smart-case") (t "exact")))) :update irony--server-query-update) :args (nil nil) :result #s(irony-iotask-result :-tag value :-value nil :-error nil :-error-data nil) :plist nil :continuation nil) :callback #f(compiled-function (candidates-result) #<bytecode 0x44f0fee5>) :schedule-buffer #<buffer test.cpp>) #s(irony-iotask-result :-tag value :-value nil :-error nil :-error-data nil))
  irony-iotask--check-result(#<process Irony>)
  irony-iotask-process-filter(#<process Irony> "(\n)\n\n;;EOT\n")

Could you please tell me how to avoid the bug. Thanks very much for helping.