Scala Programming Language
  1. Scala Programming Language
  2. SI-7280

Completions not found for members imported from an object

    Details

      Description

      No scope completion on members imported from an object. Vals are not found at all. Methods are found, unless the import is inside a `def`.

      This suggests that the presentation compiler mistreats imports in the Context used for completions.

      object Cont {
        val myVal = 42
        def longName() {}
      }
      
      import Cont._
      object T{
      
        def foo {
          /*!*/ // `myVal` does not show up, but `longName` does
        }
      }
      

        Activity

        Hide
        Iulian Dragos added a comment -

        IDE ticket: #1001615

        Show
        Iulian Dragos added a comment - IDE ticket: #1001615
        Hide
        Luc Bourlier added a comment -

        There are 2 problems reported in this ticket: vals not being found, and defs not being found sometime.

        Some information about the vals is provided by scope completion. Scala IDE currently filters out this information. We will see if it can be fixed on the Scala IDE side, or if we need to open another ticket for this case.

        So, the remaining test case for the defs is the following:

        object Cont {
          def longName() {}
        }
        
        class ImportOut {
          import Cont._
        
          def foo {
            /*_*/   // `longName` is in the scope members
          }
        }
        
        class ImportIn {
          def foo {
            import Cont._
            /*_*/   // `longName` is not in the scope members
          }
        }
        
        Show
        Luc Bourlier added a comment - There are 2 problems reported in this ticket: vals not being found, and defs not being found sometime. Some information about the vals is provided by scope completion. Scala IDE currently filters out this information. We will see if it can be fixed on the Scala IDE side, or if we need to open another ticket for this case. So, the remaining test case for the defs is the following: object Cont { def longName() {} } class ImportOut { import Cont._ def foo { /*_*/ // `longName` is in the scope members } } class ImportIn { def foo { import Cont._ /*_*/ // `longName` is not in the scope members } }
        Hide
        Jason Zaugg added a comment -

        I discussed this one quickly with Iulian last week. I think `ContextTrees#locateContext` is at fault.

        It seems we have no tests at all for scope completion. I extended InteractiveTest to support this on a branch: https://github.com/retronym/scala/compare/scala:2.10.x...ticket%2Fcompletion2

        Show
        Jason Zaugg added a comment - I discussed this one quickly with Iulian last week. I think `ContextTrees#locateContext` is at fault. It seems we have no tests at all for scope completion. I extended InteractiveTest to support this on a branch: https://github.com/retronym/scala/compare/scala:2.10.x...ticket%2Fcompletion2
        Hide
        Iulian Dragos added a comment -

        For some reason Luc can't assign the ticket to himself... Any special group he needs to be part of?

        Show
        Iulian Dragos added a comment - For some reason Luc can't assign the ticket to himself... Any special group he needs to be part of?
        Hide
        Jason Zaugg added a comment -

        I've just added him to the jira-developers group

        Show
        Jason Zaugg added a comment - I've just added him to the jira-developers group

          People

          • Assignee:
            Luc Bourlier
            Reporter:
            Iulian Dragos
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development