irony-mode icon indicating copy to clipboard operation
irony-mode copied to clipboard

irony doesn't show member functions or constructor arguments

Open ankitm123 opened this issue 6 years ago • 3 comments

@Sarcasm, I started using irony mode in emacs some days back. Lot of things work, however when I try to get autocomplete options for a constructor arguments with new keyword, irony suggests lot of things, but not the constructor arguments. Also, when I try to get the member functions for an object, it does not show them. Here are the contents of my .emacs file:

(require 'package)
; add MELPA to repository list
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
; initialize package.el(package-initialize)

;;ya-snippet
(yas-global-mode 1)

;;company-mode(add-hook 'after-init-hook 'global-company-mode)

;;irony-mode
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)

(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
;;company-irony-c-headers(require 'company-irony-c-headers)
;; Load with `irony-mode` as a grouped backend

and .clang_complete file:

-std=c++14
-Wall
-Wextra
-pthread
-I/cvmfs/cms.cern.ch/slc6_amd64_gcc530/lcg/root/6.08.07/include

It might be some small configuration option that I am missing. A code example:

TH1F *h1 =  new TH1F("h1", "Some title", 100, 0, 100); //Also no completion when hitting M-RET after the second TH1F
h1-><no completion when hitting M-RET>

But I do get completion when I just enter TH1F or TH1F:: and then press <META-RET> Seems like it was first addressed here: https://github.com/Sarcasm/company-irony/issues/1

ankitm123 avatar Sep 10 '17 12:09 ankitm123

Do you reproduce the second issue with this minimal example?

struct TH1F
{
  TH1F(const char *, const char *, int, int, int) {}

  void foo() {}
  void bar() {}
};

void f() {
  TH1F *h1 =  new TH1F("h1", "Some title", 100, 0, 100);
  h1->
}

Regarding the completion after new, I do not have it either, but not problem completing h1->|.

Sarcasm avatar Sep 12 '17 21:09 Sarcasm

You are correct, I don't know why they were not showing at that time, they seem to work perfect 👍 As for new, I think I can live with TH1F:: atm. Any ideas when, we can get the completion to work for new? This package has been a lifesaver, you did an awesome job :)

ankitm123 avatar Sep 13 '17 15:09 ankitm123

Any ideas when, we can get the completion to work for new?

No idea, I don't plan on working on this for now. I don't know if the issue is on irony-server side or in libclang. If it's in irony-server, the fix should be easy, but if it's in libclang this may be more involved.

Sarcasm avatar Sep 13 '17 16:09 Sarcasm