سؤال

When I type "Log",it shows: When I type

Then I add a comma,it shows what I want now: When I type

Why doesn't it shows all candidates when I typed "Log"?

هل كانت مفيدة؟

المحلول

Log class isn't shown the first time because it's not imported, and there are imported symbols that sort of match your prefix. After you type dot, completion searches for everything that could match before dot. See also discussion at http://youtrack.jetbrains.com/issue/IDEA-107540.

نصائح أخرى

IDE make suggestions about your input to reduce amount of proposals. You could turn it off in settings pane (see link), or use Ctrl+Space+Space to see full completion list.

More information about basic code completion you could find here. Also I suggest you to read the next article which is about Smart complition. This is very useful feature.

When you type 'Log' IntelliJ searches for any symbol with Log in it that you may by trying to type. When you type the dot, intellij then understands that you want to dereference a log object -- it'll look for the closest definition of log within the current scope, and will give you a list of things you can access on a log, such as the debug() method.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top