Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find declaration or Could not find symbol #153

Closed
NikkiKoole opened this issue Aug 8, 2014 · 13 comments
Closed

Could not find declaration or Could not find symbol #153

NikkiKoole opened this issue Aug 8, 2014 · 13 comments

Comments

@NikkiKoole
Copy link

I am trying to get DCD working together with emacs24, (in debian wheezy)
I followed all steps in both setups:

  • dcd-server and dcd-client are built succesfully
  • they both have their path set.
  • emacs' el file is getting loaded, all the ac-dcd functions are callable from within emacs
  • I've set the flags (dcd-server, dcd-client are findable) (I can start a server session from withing emacs, I know this because I can close it, when I close again it says: process dcd-server doesn't exist, so I assume it did exist the first time I tried closing it )
  • I've set the imports by writing the file dcd.conf.
    that file is :

/usr/include/dmd/
/home/nikki/projects/d/DerelictSDL2/

it gets found because the first line on dcd-server says:
[info ] Loading configuration from /home/nikki/.config/dcd/dcd.conf,
when I run dcd-server on the terminal I see its loading symbols .

I am starting the server from the terminal, I see all loading symbols and all is green, but when I actually open a file in emacs, and try any of the C-c .?, functions I just see messages like

[error] Could not find declaration of DerelictSDL2 from position 636
[error] Could not find symbol

[error] Could not find declaration of writefln from position 1122
[error] Could not find symbol

I believe I am just missing one detail, but I don't know which one ;)
could someone point me in the right direction ?

@Hackerpilot
Copy link
Collaborator

This is going to sound like a dumb question, but did you import std.stdio? DCD filters its autocomplete list based on the import statements in the file.

@Hackerpilot
Copy link
Collaborator

One other thing. Try changing:

/usr/include/dmd/

to

/usr/include/dmd/phobos/
/usr/include/dmd/druntime/import/

DCD looks for imports the way DMD does. If you tell it to import "std.stdio" with that include path it will try "/usr/include/dmd/std/stdio.d", which doesn't exist.

@NikkiKoole
Copy link
Author

;) I did import that file yes, by the way I forgot to ask I've installed all emacs reqs (popwin, autocomplete, yasnippet) but when I open a .d file which minor modes should then be running ?

edit: i've changed those lines, it doesn't look like it changed anything though, when I start the dcd-server I see all the [info] getting symbols, (for the same files as before) but the 'could not find declaration/symbol problem' still persists.

@Hackerpilot
Copy link
Collaborator

I don't even know what a minor mode is.

@NikkiKoole
Copy link
Author

changing the conf lines did do something though, I managed to jump to the definition of writefln !
a minor mode has todo with emacs, you can have 1 major mode (in this case D) and a couple of minor modes that aid you.

I still don't know why the autocompletion is not showing, and I also don't get the same jumping to definition working for the derelictSDL import .

progress though cool

@NikkiKoole
Copy link
Author

the issue was the derelictSDL path wasn't deep enough (like the dmd one) now my conf file is
/usr/include/dmd/phobos/
/usr/include/dmd/druntime/import/
/home/nikki/projects/d/DerelictSDL2/source/

and I can jump to all definitions, now that's something!

Hackerpilot added a commit that referenced this issue Aug 8, 2014
Clarify documentation as a result of #153
@Hackerpilot
Copy link
Collaborator

I've updated the readme to make DCD's handling of import directories more clear.

@NikkiKoole
Copy link
Author

cool, so my nooby questions actually lead to some use for others!, speaking about nooby questions, now it's safe to assume the definitions and symbols can be found (since I can goto them via Cc. ); have you got an idea why the autocompletion isn't kicking in ?

I've installed all requirements (auto-complete package. yasnippet and popwin ), but the autcomplete popup never shows, when I trigger it to come up manually wih auto-complete-mode, ac-start, it's not shown either.
When i do the same in some arbitrary other file (lisp or C for example) it shows the autocompletion by doing that.
just for test's sake i've downloaded textadept to see if that magically did show autocompletion, it didn't ;)

@NikkiKoole
Copy link
Author

enabling autocomplete mode and then writing 'SDL_' then I call the autocomplete command manually it gives me this feedback :
apply: Wrong type argument: stringp, ("-c" "1677" "-p" "9166")

@NikkiKoole
Copy link
Author

I've tried to get autocompletion going as described here #106
on the terminal, and I do get a result
server says [info ] Getting completions
and nikki@crunchbang:~/test$ dcd-client --cursorPos 79 test.d
identifiers
MyUint l
alignof k
init k
mangleof k
sizeof k
stringof k
tupleof k

but this [info] getting completions is not triggered anyway from within emacs..

@tsukimizake
Copy link
Contributor

Pardon me for jumping in. I'm one of the maintainers of emacs integration.
Can you try to edit line 153 of ac-dcd.el
from
(defun ac-dcd-call-process (prefix &rest args)

to
(defun ac-dcd-call-process (prefix args)

and M-x eval-buffer, then retry?
It seems to be a bug of recent commit. If it works on your enviroment, I'll write a pull request at once.

@NikkiKoole
Copy link
Author

@tsukimizake
yes! that solved it immediately ;)

I've got autocompletion woohoo, and a haunting 'Exit the snippet first'.. :)
that little issue is similar as described joaotavora/yasnippet#459 and the fix for that works here too I believe

(add-hook 'd-mode-hook 'yas-minor-mode-on)

@tsukimizake
Copy link
Contributor

@NikkiKoole
I'm glad to hear that. Enjoy!
And thanks for the report about yas-minor-mode. I'll update README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants