Skip to content
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

Dropdown for Table.join right is wrong #5055

Closed
wdanilo opened this issue Feb 5, 2023 · 8 comments · Fixed by #5747
Closed

Dropdown for Table.join right is wrong #5055

wdanilo opened this issue Feb 5, 2023 · 8 comments · Fixed by #5747
Assignees
Labels
--bug Type: bug -language-server -libs Libraries: New libraries to be implemented p-low Low priority

Comments

@wdanilo
Copy link
Member

wdanilo commented Feb 5, 2023

This task is automatically imported from the old Task Issue Board and it was originally created by jaroslavtulach.
Original issue is here.


Discovered during book clubing.

There is a drop down for Table.join right argument! And it offers Table.Value. Table.Value is just a function which needs a parameter of java_table, so it makes no sense to offer it as tag_value.

Comments:

(jaroslavtulach - Feb 2, 2023)


@jdunkerley jdunkerley added this to the Beta Release milestone Feb 6, 2023
@jdunkerley jdunkerley moved this to ❓New in Issues Board Feb 7, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Feb 14, 2023
@jdunkerley
Copy link
Member

Please let us know how to determine what ends up in tagValues and the logic we need to control this.

@JaroslavTulach
Copy link
Member

To determine what ends up in tagValues one needs to put breakpoint to buildResolvedUnionTypeName. Or better have three breakpoints:

enso$ git diff engine/runtime/src/main/scala/org/enso/compiler/context/SuggestionBuilder.scala
diff --git a/engine/runtime/src/main/scala/org/enso/compiler/context/SuggestionBuilder.scala b/engine/runtime/src/main/scala/org/enso/compiler/context/SuggestionBuilder.scala
index b2161b2d3..23d9789da 100644
--- a/engine/runtime/src/main/scala/org/enso/compiler/context/SuggestionBuilder.scala
+++ b/engine/runtime/src/main/scala/org/enso/compiler/context/SuggestionBuilder.scala
@@ -106,6 +106,9 @@ final class SuggestionBuilder[A: IndexedSource](
                   _
                 ) if !m.isStaticWrapperForInstanceMethod =>
             val typeSignature = ir.getMetadata(TypeSignatures)
+            if (methodName.toString().contains("join")) {
+                System.out.println("Found method " + methodName)
+            }
             val (selfTypeOpt, isStatic) = typePtr match {
               case Some(typePtr) =>
                 val selfType = typePtr
@@ -200,6 +203,9 @@ final class SuggestionBuilder[A: IndexedSource](
     }
 
     val builder: TreeBuilder = Vector.newBuilder
+    if (module.toString().endsWith("Table")) {
+      System.err.println("Processing " + module)
+    }
     builder += Tree.Node(
       buildModule(
         module,

and stop when one is processing Standard.Table.Data.Table module and join method. Then stop in the buildResolvedUnionTypeName.

Doing that one finds out there is Value java_table which is seen as:

BindingsMap$Type
  name = "Table" 
  members = [ BindingsMap$Cons name="Value" arity = 1 allFieldsDefaulted=false ]

e.g. offering Table.Value is as good as offering Filter_Condition.Equal which is what #5656 wants to offer. Alas they aren't really distinguishable from the perspective of the SuggestionBuilder.

Ideas @jdunkerley, @Frizi & co.?

@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to ⚙️ Design in Issues Board Feb 22, 2023
@hubertp
Copy link
Collaborator

hubertp commented Feb 22, 2023

@jdunkerley Here are is a clue from Dmitry that I once got on debugging suggestions:

If you want to observe the database, the easiest way is to create a file-based one instead of in-memory

with
val sqlDatabase = SqlDatabase(languageServerConfig.directories.suggestionsDatabaseFile)
and then use CLI
$ sqlite3 /path/to/suggestions.db

@JaroslavTulach
Copy link
Member

offering Table.Value is as good as offering Filter_Condition.Equal which is what #5656 wants to offer. Alas they aren't really distinguishable from the perspective of the SuggestionBuilder.

@jdunkerley proposes to ignore tagValues with a single entry in SuggestionBuilder. Let's do it!

@JaroslavTulach JaroslavTulach moved this from ⚙️ Design to 🔧 Implementation in Issues Board Feb 23, 2023
@enso-bot
Copy link

enso-bot bot commented Feb 24, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-02-23):

Progress: - PR with design for Table.Value ready for discussion: #5747

  • some discussion about the design needed
  • Meeting about IO contexts
  • review Nan: NaN is a new builtin type #5744
  • debugging JSON Serialization and deserialization
  • finally understand how Jackson works: f413b62#r1116136929
  • can serialize records: 958cc78
  • discussion about TRegex It should be finished by 2023-03-06.

Next Day: Focus on serialization of suggestion cache.

@enso-bot
Copy link

enso-bot bot commented Feb 25, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-02-24):

Progress: - discussion about Table.Value (and now also Pair.Value) continues: #5747 (comment)

Next Day: Vacation on Monday.

@enso-bot
Copy link

enso-bot bot commented Feb 26, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-02-25):

Progress: - Table.Value, Pair.Value - awaits: #5747 (comment)

Next Day: Vacation on Monday.

GitHub
GraalVM: Run Programs Faster Anywhere 🚀. Contribute to oracle/graal development by creating an account on GitHub.

@mergify mergify bot closed this as completed in #5747 Feb 28, 2023
mergify bot pushed a commit that referenced this issue Feb 28, 2023
Resolving #5055 - avoid putting single constructor into suggestion database.

# Important Notes
Another way to fix #5055 is to keep the single constructor information in the suggestion database and let the IDE filter that out.
@github-project-automation github-project-automation bot moved this from 🔧 Implementation to 🟢 Accepted in Issues Board Feb 28, 2023
@enso-bot
Copy link

enso-bot bot commented Mar 1, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-02-28):

Progress: - Table.Value solved and integrated

Next Day: Cache invalidations & request timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -language-server -libs Libraries: New libraries to be implemented p-low Low priority
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants