Giter Site home page Giter Site logo

Comments (7)

lespaul avatar lespaul commented on July 17, 2024

Here's a prototype/implementation of the function you've bound to "C-c C-e s"

(defun eclim-java-method-signature-at-point ()
  "Find and display the method signature at point."
  (interactive)
  (let ((i (eclim--java-identifier-at-point t)))
    ;note: for some reason the "-t 'method'" portion of command doesn't function as expected for non-methods.
    (eclim/with-results hits ("java_search" "-n" "-f" ("-o" (car i)) ("-l" (length (cdr i))) ("-t" "method") ("-x" "declarations"))
      (echo-signature hits))))

(defun eclim-java-echo-signature (results)
  (if (= 1 (length results))
      (let ((result (elt results 0)))
        (message (assoc-default 'message result)))
    (error "found more than 1 result")))

I think there is a bug in the eclim code that handles the type request. In theory, running this function on a member variable should throw an error, but eclim still returns a result.

from emacs-eclim.

senny avatar senny commented on July 17, 2024

@ervandew do you have an insight on the problem @lespaul found?

from emacs-eclim.

ervandew avatar ervandew commented on July 17, 2024

Is the question: Why is eclim returning a result when -t method was
supplied with the offset of an non-method element?

If so then the answer is that -t ... argument is ignored for element
based searches since the type of the element is known. It's only used
for pattern searches where the type is not known.

If that's not the question, then I guess I need some clarification.

from emacs-eclim.

lespaul avatar lespaul commented on July 17, 2024

Thanks for answering the question! You're answering what I was confused about.

from emacs-eclim.

skybert avatar skybert commented on July 17, 2024

Sounds very promising this feature. It does seem that it's only half way there in the source, though. The shortcut is registered in emacs-eclim.el, but the function cannot be found anymore (I see it was there once upon a time):

command-execute: Symbol's function definition is void: eclim-java-method-signature-at-point

from emacs-eclim.

kleewho avatar kleewho commented on July 17, 2024

My idea is to use info we have when completing symbol. There's info about method arguments so if I'll send smart arguments to complete (the right method name + maybe method arity) then I believe required eldoc info will be in place.

The problem I have right now is how to know that I'm in method call somewhere and how exactly is that method named. expand-region have special extension to eventually mark the method call... so I might look into this and maybe hack it somehow with it, but maybe (most probably) there's better way.

Is it reasonable approach?

from emacs-eclim.

vspinu avatar vspinu commented on July 17, 2024

Any progress on this?

from emacs-eclim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.