Re: [cedet-semantic] default visibility in Java
Brought to you by:
zappo
From: Eric M. L. <eri...@gm...> - 2012-06-16 02:17:42
|
On 06/08/2012 03:22 AM, Fredrik Malmros wrote: > Hi, > > There seems to be an issue with visibility when completing members with > default visibility i.e. members or classes without access modifier in Java. > When calling semantic-analyze-possible-completion with point at ^ in the > class below, I get: > void baz(), but I expect to get both void baz() and void bar() since bar > is visible in Foo (and all other classes in the same package as Foo). > > public class Foo { > void bar () {} > > private void baz () { > b > ^ > } > } Hi, Sorry for the late reply. The java utilities return the protection of 'bar' as being 'nil', and 'baz' as being 'private'. I think all that is needed is for java to override semantic-tag-protection to return private if nothing was specified. (If private is the right thing. I'm not that familiar with java. This patch should solve the problem if 'private is the right answer. Please let me know if unspecified protection means private. Thanks Eric ------------ === modified file 'lisp/cedet/semantic/java.el' *** lisp/cedet/semantic/java.el 2011-11-07 20:57:12 +0000 --- lisp/cedet/semantic/java.el 2012-06-16 02:14:07 +0000 *************** *** 173,178 **** --- 173,187 ---- (semantic-find-tags-by-class 'type (semantic-find-tag-by-overlay point)))) + ;; Tag Protection + ;; + (define-mode-local-override semantic-tag-protection + java-mode (tag &optional parent) + "Return the protection of TAG in PARENT. + Override function for `semantic-tag-protection'." + (let ((prot (semantic-tag-protection-default tag parent))) + (or prot 'private))) + ;; Prototype handler ;; (defun semantic-java-prototype-function (tag &optional parent color) |