Eclipse content assist auto appends type for variable

前端 未结 5 1873
Happy的楠姐
Happy的楠姐 2021-01-04 03:58

I just started to use Juno for a couple of days, the content assist mechanism seems different from what it behaves before.

For example, if I try to declare a variabl

5条回答
  •  死守一世寂寞
    2021-01-04 04:23

    What you see there is name completion for object types. And this may often make sense, e.g. pressing Ctrl-Space after List book will complete that to List bookList. For primitive types this is not done, so int count will not get any completion when pressing Ctrl-Space. This would be a (not really good) solution to your problem by declaring the variable as primitve boolean.

    What I really recommend as solution is to change your style of writing variable declarations. For your example, write isVisible = false instead, have the editor complain about the missing type declaration, hit Ctrl-1 (from wherever your cursor might be placed), Enter.

提交回复
热议问题