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

completion for java-interop calls #6

Open
laurentpetit opened this issue Jun 15, 2012 · 4 comments
Open

completion for java-interop calls #6

laurentpetit opened this issue Jun 15, 2012 · 4 comments

Comments

@laurentpetit
Copy link
Collaborator

a feature Counterclockwise had is completion for java interop calls.

e.g. ".toSr" would get suggestions for ".toString", etc.

There are several things to discuss about the detail.

Side note: question about function ns-java-methods: I see ":when (static? ..." where I would have expected ":when (not (static? ..."

@laurentpetit
Copy link
Collaborator Author

ninjudd: As far as java completion goes, I didn't consider tackling instance method completion because the instance type is unknown when you are typing the method. That's why ns-java-methods only returns static method names.

(Imported from another issue)

@laurentpetit
Copy link
Collaborator Author

trptcolin: For REPLy's needs, instance method completion for imported classes would be awesome. I've had it on my to-do list for awhile. Your ns-java-methods change seems right to me as well - it might already work after dropping that in.

(Imported from another issue)

@laurentpetit
Copy link
Collaborator Author

kotarak:As for the method completion: It could be limited to methods of import'd classes. That would be better than nothing and have a certain probability of matching.

(Imported from another issue)

@laurentpetit
Copy link
Collaborator Author

@ninjudd , @trptcolin , @kotarak : Indeed the fundamental problem is that the completions one would like to get are hard to get right, because there's not enough context. In my particular case of hacking Counterclockwise in Clojure, it's especially harder to work with the Eclipse API from Clojure code than from Java code where I'm accustomed to "discover API via code-completion as you go" - style.

So for this particular function, having only the prefix and the current namespace as context are far from ideal.

But I agree with Meikel and Colin that having, for a start, instance method completion for classes imported in the current namespace is better than nothing !

In the future, we may have to think about ways to gather more "context" for this style of completion : for example IDEs could try to be "smart" by "sneaking" the types of the input/output objects passed to functions during tests.

Another idea, stolen from Enclojure : give the context by having the prefix include the class imported name (or any class fully qualified name) : "String/toS" would then resolve to ".toString"

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

1 participant