Skip to content

Unexpected completion content #4535

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

Closed
Glavo opened this issue May 15, 2018 · 0 comments
Closed

Unexpected completion content #4535

Glavo opened this issue May 15, 2018 · 0 comments

Comments

@Glavo
Copy link
Contributor

Glavo commented May 15, 2018

When I tried to complete null, I accidentally received the collection method:

scala> null. 
Elements               addString              count                  getChars               lines                  reduceRightOption      stripLineEnd           toMap
Self                   aggregate              deep                   getClass               linesIterator          regionMatches          stripMargin            toSeq
WithFilter             andThen                diff                   getStackTraceString    linesWithSeparators    replace                stripPrefix            toSet
!=                     apply                  distinct               groupBy                map                    replaceAll             stripSuffix            toShort
##                     applyOrElse            drop                   grouped                matches                replaceAllLiterally    subSequence            toStream
%                      array                  dropRight              hasDefiniteSize        max                    replaceFirst           substring              toString
&                      asInstanceOf           dropWhile              hashCode               maxBy                  repr                   sum                    toTraversable
&&                     canEqual               elemManifest           head                   min                    reverse                synchronized           toUpperCase
*                      capitalize             elemTag                headOption             minBy                  reverseIterator        tail                   toVector
+                      charAt                 endsWith               indexOf                mkString               reverseMap             tails                  transform
++                     chars                  ensuring               indexOfSlice           ne                     reversed               take                   transpose
++:                    clone                  eq                     indexWhere             newBuilder             runWith                takeRight              trim
+:                     codePointAt            equals                 indices                nonEmpty               sameElements           takeWhile              unary_!
-                      codePointBefore        equalsIgnoreCase       init                   notify                 scan                   thisCollection         unary_+
->                     codePointCount         exists                 inits                  notifyAll              scanLeft               to                     unary_-
/                      codePoints             filter                 intern                 offsetByCodePoints     scanRight              toArray                unary_~
/:                     collect                filterNot              intersect              orElse                 segmentLength          toBoolean              union
:+                     collectFirst           finalize               invert                 padTo                  self                   toBuffer               unzip
:\                     combinations           find                   isDefinedAt            par                    seq                    toByte                 unzip3
<                      companion              flatMap                isEmpty                parCombiner            size                   toChar                 update
<<                     compare                flatten                isInstanceOf           partition              sizeHintIfCheap        toCharArray            updated
<=                     compareTo              fold                   isTraversableAgain     patch                  slice                  toCollection           view
<init>                 compareToIgnoreCase    foldLeft               iterator               permutations           sliding                toDouble               wait
==                     compose                foldRight              last                   prefixLength           sortBy                 toFloat                withFilter
>                      concat                 forall                 lastIndexOf            product                sortWith               toIndexedSeq           zip
>=                     contains               foreach                lastIndexOfSlice       r                      sorted                 toInt                  zipAll
>>                     containsSlice          format                 lastIndexWhere         reduce                 span                   toIterable             zipWithIndex
>>>                    contentEquals          formatLocal            lastOption             reduceLeft             split                  toIterator             zipped
^                      copyToArray            formatted              length                 reduceLeftOption       splitAt                toList                 |
__arrayOfChars         copyToBuffer           genericBuilder         lengthCompare          reduceOption           startsWith             toLong                 ||
__sequenceOfChars      corresponds            getBytes               lift                   reduceRight            stringPrefix           toLowerCase

But I can't call them:

scala> null.isEmpty 
1 |null.isEmpty
  |^^^^^^^^^^^^
  |value `isEmpty` is not a member of Null

And the <init> method also appears in the completion content:

scala> 0. 
ResultWithoutStep         <init>                    compareTo                 isInfinite                max                       toBinaryString            unary_+
!=                        ==                        doubleValue               isInfinity                min                       toByte                    unary_-
##                        >                         ensuring                  isInstanceOf              ne                        toChar                    unary_~
%                         >=                        eq                        isNaN                     notify                    toDegrees                 underlying
&                         >>                        equals                    isNegInfinity             notifyAll                 toDouble                  unifiedPrimitiveEquals
*                         >>>                       finalize                  isPosInfinity             num                       toFloat                   unifiedPrimitiveHashcode
+                         ^                         floatValue                isValidByte               ord                       toHexString               until
-                         abs                       floor                     isValidChar               round                     toInt                     wait
->                        asInstanceOf              formatted                 isValidInt                self                      toLong                    |
/                         byteValue                 getClass                  isValidLong               shortValue                toOctalString
<                         ceil                      hashCode                  isValidShort              signum                    toRadians
<<                        clone                     intValue                  isWhole                   synchronized              toShort
<=                        compare                   integralNum               longValue                 to                        toString
scala> (). 
!=            +             <init>        asInstanceOf  equals        getClass      isInstanceOf
##            ->            ==            ensuring      formatted     hashCode      toString
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 18, 2019
Do not complete on Nothing and complete as AnyRef for Null.

Add missing Artifact to remove `$isInstanceOf` completion and
workaround missing decoding for `$u2192` to `→`.
@nicolasstucki nicolasstucki self-assigned this Jan 18, 2019
nicolasstucki added a commit that referenced this issue Jan 21, 2019
Fix #4535: Handle Null and Nothing in completions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants