From 4410b3ff6a4670da370cae7b2f0b02259995ca87 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Fri, 5 Mar 2021 17:02:25 +0300 Subject: [PATCH 1/6] feat: index Builtins --- .../instrument/job/EnsureCompiledJob.scala | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala index 67144856e253..71529f19d2e7 100644 --- a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala +++ b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala @@ -73,8 +73,7 @@ class EnsureCompiledJob(protected val files: Iterable[File]) ctx.executionService.getContext.getModuleForFile(file).toScala } val modulesInScope = - ctx.executionService.getContext.getTopScope.getModules.asScala - .filterNot(m => modules.exists(_ == m)) + getModulesInScope.filterNot(m => modules.exists(_ == m)) val moduleCompilationStatus = modules.map(ensureCompiledModule) val scopeCompilationStatus = ensureCompiledScope(modulesInScope) (moduleCompilationStatus ++ scopeCompilationStatus).maxOption @@ -144,11 +143,7 @@ class EnsureCompiledJob(protected val files: Iterable[File]) e ) } - if ( - !module.isIndexed && - module.getLiteralSource != null && - module.getPath != null - ) { + if (!module.isIndexed && module.getLiteralSource != null) { ctx.executionService.getLogger .log(Level.FINEST, s"Analyzing module in scope ${module.getName}") val moduleName = module.getName @@ -157,7 +152,7 @@ class EnsureCompiledJob(protected val files: Iterable[File]) .filter(isSuggestionGlobal) val version = ctx.versioning.evalVersion(module.getLiteralSource.toString) val notification = Api.SuggestionsDatabaseModuleUpdateNotification( - file = new File(module.getPath), + file = getIndexingPath(module), version = version, actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName.toString)), @@ -430,6 +425,26 @@ class EnsureCompiledJob(protected val files: Iterable[File]) case _ => None } + /** Get all modules in the current compiler scope. */ + private def getModulesInScope(implicit + ctx: RuntimeContext + ): Iterable[Module] = { + val topScope = ctx.executionService.getContext.getTopScope + val modulesInScope = topScope.getModules.asScala + val builtins = topScope.getBuiltins.getModule + modulesInScope ++ Seq(builtins) + } + + /** Get the module path for suggestions database indexing. + * + * If the module is synthetic (i.e. Builtins), uses its name as a path. + */ + private def getIndexingPath(module: Module): File = + if (module.getPath eq null) { + new File(s"/${module.getName}") + } else + new File(module.getPath) + } object EnsureCompiledJob { From 7efc726c2165290453270e576e1a1fd5e37b9c97 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Sat, 13 Mar 2021 10:50:51 +0300 Subject: [PATCH 2/6] feat: enableSuggestions runtime option --- .../main/java/org/enso/polyglot/RuntimeOptions.java | 10 ++++++++-- .../java/org/enso/interpreter/runtime/Context.java | 4 ++++ .../interpreter/instrument/job/EnsureCompiledJob.scala | 9 +++++++-- .../test/instrument/ExpressionErrorsTest.scala | 1 + .../test/instrument/RuntimeInstrumentTest.scala | 1 + 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java b/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java index 384c4d89839c..14442d2187f5 100644 --- a/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java +++ b/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java @@ -30,7 +30,7 @@ public class RuntimeOptions { OptionDescriptor.newBuilder(LOG_LEVEL_KEY, LOG_LEVEL).build(); public static final String INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION = - interpreterOptionName(".sequentialCommandExecution"); + interpreterOptionName("sequentialCommandExecution"); public static final OptionKey INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION_KEY = new OptionKey<>(false); public static final OptionDescriptor INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION_DESCRIPTOR = @@ -39,6 +39,11 @@ public class RuntimeOptions { INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION) .build(); + public static final String ENABLE_SUGGESTIONS = optionName("enableSuggestions"); + public static final OptionKey ENABLE_SUGGESTIONS_KEY = new OptionKey<>(true); + private static final OptionDescriptor ENABLE_SUGGESTIONS_DESCRIPTOR = + OptionDescriptor.newBuilder(ENABLE_SUGGESTIONS_KEY, ENABLE_SUGGESTIONS).build(); + public static final OptionDescriptors OPTION_DESCRIPTORS = OptionDescriptors.create( Arrays.asList( @@ -46,7 +51,8 @@ public class RuntimeOptions { STRICT_ERRORS_DESCRIPTOR, LOG_LEVEL_DESCRIPTOR, DISABLE_INLINE_CACHES_DESCRIPTOR, - INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION_DESCRIPTOR)); + INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION_DESCRIPTOR, + ENABLE_SUGGESTIONS_DESCRIPTOR)); /** * Canonicalizes the option name by prefixing it with the language name. diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java index ae696bbd3347..bfb9a98848a4 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java @@ -314,6 +314,10 @@ public boolean isStrictErrors() { return getEnvironment().getOptions().get(RuntimeOptions.STRICT_ERRORS_KEY); } + public boolean isSuggestionsEnabled() { + return getEnvironment().getOptions().get(RuntimeOptions.ENABLE_SUGGESTIONS_KEY); + } + /** Creates a new thread that has access to the current language context. */ public Thread createThread(Runnable runnable) { return environment.createThread(runnable); diff --git a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala index 71529f19d2e7..5720620474e6 100644 --- a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala +++ b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala @@ -41,6 +41,7 @@ class EnsureCompiledJob(protected val files: Iterable[File]) /** @inheritdoc */ override def run(implicit ctx: RuntimeContext): CompilationStatus = { ctx.locking.acquireWriteCompilationLock() + try { val compilationResult = ensureCompiledFiles(files) ctx.contextManager.getAll.values.foreach { stack => @@ -96,7 +97,9 @@ class EnsureCompiledJob(protected val files: Iterable[File]) val cacheInvalidationCommands = buildCacheInvalidationCommands(changeset, module.getLiteralSource) runInvalidationCommands(cacheInvalidationCommands) - analyzeModule(module, changeset) + if (ctx.executionService.getContext.isSuggestionsEnabled) { + analyzeModule(module, changeset) + } runCompilationDiagnostics(module) } .getOrElse(CompilationStatus.Failure) @@ -125,7 +128,9 @@ class EnsureCompiledJob(protected val files: Iterable[File]) ) CompilationStatus.Failure case Right(module) => - analyzeModuleInScope(module) + if (ctx.executionService.getContext.isSuggestionsEnabled) { + analyzeModuleInScope(module) + } runCompilationDiagnostics(module) } } diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala index 622826caa686..b009e5f6edd7 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala @@ -55,6 +55,7 @@ class ExpressionErrorsTest .option(RuntimeOptions.PACKAGES_PATH, pkg.root.getAbsolutePath) .option(RuntimeOptions.LOG_LEVEL, "WARNING") .option(RuntimeOptions.INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION, "true") + .option(RuntimeOptions.ENABLE_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") .out(out) .serverTransport { (uri, peer) => diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala index 836ad62b792a..fdb122cce1c2 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala @@ -53,6 +53,7 @@ class RuntimeInstrumentTest .option(RuntimeOptions.PACKAGES_PATH, pkg.root.getAbsolutePath) .option(RuntimeOptions.LOG_LEVEL, "WARNING") .option(RuntimeOptions.INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION, "true") + .option(RuntimeOptions.ENABLE_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") .out(out) .serverTransport { (uri, peer) => From a2101a0a42717cebc67b3b1bd45950647ab4f972 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Sat, 13 Mar 2021 11:15:40 +0300 Subject: [PATCH 3/6] feat: global suggestions indexing runtime option --- .../java/org/enso/polyglot/RuntimeOptions.java | 16 +++++++++++----- .../org/enso/interpreter/runtime/Context.java | 18 ++++++++++++++++-- .../instrument/job/EnsureCompiledJob.scala | 4 ++-- .../test/instrument/ExpressionErrorsTest.scala | 3 ++- .../instrument/RuntimeInstrumentTest.scala | 3 ++- .../instrument/SuggestionUpdatesTest.scala | 10 +++++++--- 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java b/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java index 14442d2187f5..a5db00a1741b 100644 --- a/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java +++ b/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java @@ -39,10 +39,15 @@ public class RuntimeOptions { INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION) .build(); - public static final String ENABLE_SUGGESTIONS = optionName("enableSuggestions"); - public static final OptionKey ENABLE_SUGGESTIONS_KEY = new OptionKey<>(true); - private static final OptionDescriptor ENABLE_SUGGESTIONS_DESCRIPTOR = - OptionDescriptor.newBuilder(ENABLE_SUGGESTIONS_KEY, ENABLE_SUGGESTIONS).build(); + public static final String ENABLE_PROJECT_SUGGESTIONS = optionName("enableProjectSuggestions"); + public static final OptionKey ENABLE_PROJECT_SUGGESTIONS_KEY = new OptionKey<>(true); + private static final OptionDescriptor ENABLE_PROJECT_SUGGESTIONS_DESCRIPTOR = + OptionDescriptor.newBuilder(ENABLE_PROJECT_SUGGESTIONS_KEY, ENABLE_PROJECT_SUGGESTIONS).build(); + + public static final String ENABLE_GLOBAL_SUGGESTIONS = optionName("enableGlobalSuggestions"); + public static final OptionKey ENABLE_GLOBAL_SUGGESTIONS_KEY = new OptionKey<>(true); + private static final OptionDescriptor ENABLE_GLOBAL_SUGGESTIONS_DESCRIPTOR = + OptionDescriptor.newBuilder(ENABLE_GLOBAL_SUGGESTIONS_KEY, ENABLE_GLOBAL_SUGGESTIONS).build(); public static final OptionDescriptors OPTION_DESCRIPTORS = OptionDescriptors.create( @@ -52,7 +57,8 @@ public class RuntimeOptions { LOG_LEVEL_DESCRIPTOR, DISABLE_INLINE_CACHES_DESCRIPTOR, INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION_DESCRIPTOR, - ENABLE_SUGGESTIONS_DESCRIPTOR)); + ENABLE_PROJECT_SUGGESTIONS_DESCRIPTOR, + ENABLE_GLOBAL_SUGGESTIONS_DESCRIPTOR)); /** * Canonicalizes the option name by prefixing it with the language name. diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java index bfb9a98848a4..8bc618209ee5 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java @@ -314,8 +314,22 @@ public boolean isStrictErrors() { return getEnvironment().getOptions().get(RuntimeOptions.STRICT_ERRORS_KEY); } - public boolean isSuggestionsEnabled() { - return getEnvironment().getOptions().get(RuntimeOptions.ENABLE_SUGGESTIONS_KEY); + /** + * Checks whether the suggestions indexing is enabled for project files. + * + * @return true if project-level suggestion indexing is enabled. + */ + public boolean isProjectSuggestionsEnabled() { + return getEnvironment().getOptions().get(RuntimeOptions.ENABLE_PROJECT_SUGGESTIONS_KEY); + } + + /** + * Checks whether the suggestion indexing is enabled for external libraries. + * + * @return true if the suggestions indexing is enabled for external libraries. + */ + public boolean isGlobalSuggestionsEnabled() { + return getEnvironment().getOptions().get(RuntimeOptions.ENABLE_GLOBAL_SUGGESTIONS_KEY); } /** Creates a new thread that has access to the current language context. */ diff --git a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala index 5720620474e6..520107280bb4 100644 --- a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala +++ b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala @@ -97,7 +97,7 @@ class EnsureCompiledJob(protected val files: Iterable[File]) val cacheInvalidationCommands = buildCacheInvalidationCommands(changeset, module.getLiteralSource) runInvalidationCommands(cacheInvalidationCommands) - if (ctx.executionService.getContext.isSuggestionsEnabled) { + if (ctx.executionService.getContext.isProjectSuggestionsEnabled) { analyzeModule(module, changeset) } runCompilationDiagnostics(module) @@ -128,7 +128,7 @@ class EnsureCompiledJob(protected val files: Iterable[File]) ) CompilationStatus.Failure case Right(module) => - if (ctx.executionService.getContext.isSuggestionsEnabled) { + if (ctx.executionService.getContext.isGlobalSuggestionsEnabled) { analyzeModuleInScope(module) } runCompilationDiagnostics(module) diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala index b009e5f6edd7..dc39de7b2b63 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala @@ -55,7 +55,8 @@ class ExpressionErrorsTest .option(RuntimeOptions.PACKAGES_PATH, pkg.root.getAbsolutePath) .option(RuntimeOptions.LOG_LEVEL, "WARNING") .option(RuntimeOptions.INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION, "true") - .option(RuntimeOptions.ENABLE_SUGGESTIONS, "false") + .option(RuntimeOptions.ENABLE_PROJECT_SUGGESTIONS, "false") + .option(RuntimeOptions.ENABLE_GLOBAL_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") .out(out) .serverTransport { (uri, peer) => diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala index fdb122cce1c2..c67c88561b40 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala @@ -53,7 +53,8 @@ class RuntimeInstrumentTest .option(RuntimeOptions.PACKAGES_PATH, pkg.root.getAbsolutePath) .option(RuntimeOptions.LOG_LEVEL, "WARNING") .option(RuntimeOptions.INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION, "true") - .option(RuntimeOptions.ENABLE_SUGGESTIONS, "false") + .option(RuntimeOptions.ENABLE_PROJECT_SUGGESTIONS, "false") + .option(RuntimeOptions.ENABLE_GLOBAL_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") .out(out) .serverTransport { (uri, peer) => diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala index 52c10b2093b7..1c2010ff673f 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala @@ -46,6 +46,7 @@ class SuggestionUpdatesTest .option(RuntimeOptions.PACKAGES_PATH, pkg.root.getAbsolutePath) .option(RuntimeOptions.LOG_LEVEL, "WARNING") .option(RuntimeOptions.INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION, "true") + .option(RuntimeOptions.ENABLE_GLOBAL_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") .out(out) .serverTransport { (uri, peer) => @@ -570,7 +571,8 @@ class SuggestionUpdatesTest List( Suggestion .Argument("this", "Test.Main", false, false, None), - Suggestion.Argument("x", Constants.ANY, false, false, None) + Suggestion + .Argument("x", Constants.ANY, false, false, None) ), "Test.Main", Constants.ANY, @@ -630,7 +632,8 @@ class SuggestionUpdatesTest List( Suggestion .Argument("this", "Test.Main", false, false, None), - Suggestion.Argument("x", Constants.ANY, false, false, None) + Suggestion + .Argument("x", Constants.ANY, false, false, None) ), "Test.Main", Constants.ANY, @@ -644,7 +647,8 @@ class SuggestionUpdatesTest .Modify(1, Some("a"), None, None, None, None), Api.SuggestionArgumentAction.Add( 2, - Suggestion.Argument("b", Constants.ANY, false, false, None) + Suggestion + .Argument("b", Constants.ANY, false, false, None) ) ) ), From d992daa911ddaf1149e8dc35395f4925906f97e6 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Sat, 13 Mar 2021 11:41:04 +0300 Subject: [PATCH 4/6] test: separate suggestion tests --- .../test/instrument/RuntimeServerTest.scala | 1357 +---------------- .../instrument/SuggestionUpdatesTest.scala | 148 ++ 2 files changed, 202 insertions(+), 1303 deletions(-) diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala index e59f693dfcd5..6238db1a3150 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala @@ -6,7 +6,6 @@ import org.enso.interpreter.runtime.{Context => EnsoContext} import org.enso.interpreter.test.Metadata import org.enso.pkg.{Package, PackageManager} import org.enso.polyglot._ -import org.enso.polyglot.data.Tree import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.editing.model import org.enso.text.editing.model.TextEdit @@ -57,6 +56,8 @@ class RuntimeServerTest .option(RuntimeOptions.PACKAGES_PATH, pkg.root.getAbsolutePath) .option(RuntimeOptions.LOG_LEVEL, "WARNING") .option(RuntimeOptions.INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION, "true") + .option(RuntimeOptions.ENABLE_PROJECT_SUGGESTIONS, "false") + .option(RuntimeOptions.ENABLE_GLOBAL_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") .out(out) .serverTransport { (uri, peer) => @@ -624,7 +625,6 @@ class RuntimeServerTest | this.foo 1 2 |""".stripMargin.linesIterator.mkString("\n") val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -635,7 +635,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -653,7 +653,7 @@ class RuntimeServerTest ) ) ) - context.receive(5) should contain theSameElementsAs Seq( + context.receive(4) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update( contextId, @@ -662,57 +662,6 @@ class RuntimeServerTest Api.MethodPointer(moduleName, "Test.Main", "foo") ), TestMessages.update(contextId, idMain, Constants.INTEGER), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "foo", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None), - Suggestion - .Argument("a", Constants.ANY, false, false, None), - Suggestion - .Argument("b", Constants.ANY, false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - List( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) } @@ -735,7 +684,6 @@ class RuntimeServerTest | IO.println (this.foo 1 2) |""".stripMargin.linesIterator.mkString("\n") val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -746,7 +694,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -764,7 +712,7 @@ class RuntimeServerTest ) ) ) - context.receive(5) should contain theSameElementsAs Seq( + context.receive(4) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update( contextId, @@ -773,57 +721,6 @@ class RuntimeServerTest Api.MethodPointer(moduleName, "Test.Main", "foo") ), TestMessages.update(contextId, idMain, Constants.NOTHING), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "foo", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None), - Suggestion - .Argument("a", Constants.ANY, false, false, None), - Suggestion - .Argument("b", Constants.ANY, false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - List( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) context.consumeOut shouldEqual List("3") @@ -846,7 +743,6 @@ class RuntimeServerTest |bar = State.get Number |""".stripMargin val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -857,7 +753,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -875,7 +771,7 @@ class RuntimeServerTest ) ) ) - context.receive(5) should contain theSameElementsAs Seq( + context.receive(4) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update( contextId, @@ -884,53 +780,6 @@ class RuntimeServerTest Api.MethodPointer(moduleName, "Test.Main", "bar") ), TestMessages.update(contextId, idMain, Constants.NOTHING), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "bar", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) context.consumeOut shouldEqual List("42") @@ -955,7 +804,6 @@ class RuntimeServerTest | State.get Number |""".stripMargin val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -966,7 +814,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -984,7 +832,7 @@ class RuntimeServerTest ) ) ) - context.receive(5) should contain theSameElementsAs Seq( + context.receive(4) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update( contextId, @@ -993,53 +841,6 @@ class RuntimeServerTest Api.MethodPointer(moduleName, "Test.Main", "bar") ), TestMessages.update(contextId, idMain, Constants.NOTHING), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "bar", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) context.consumeOut shouldEqual List("10") @@ -1064,7 +865,6 @@ class RuntimeServerTest | 1 |""".stripMargin.linesIterator.mkString("\n") val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -1075,7 +875,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -1093,7 +893,7 @@ class RuntimeServerTest ) ) ) - context.receive(5) should contain theSameElementsAs Seq( + context.receive(4) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update( contextId, @@ -1102,57 +902,6 @@ class RuntimeServerTest Api.MethodPointer(moduleName, "Test.Main", "foo") ), TestMessages.update(contextId, idMain, Constants.INTEGER), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "foo", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None), - Suggestion - .Argument("a", Constants.ANY, false, false, None), - Suggestion - .Argument("b", Constants.ANY, false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - List( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) } @@ -1282,7 +1031,6 @@ class RuntimeServerTest val moduleName = "Test.Main" val idMain = context.Main.metadata.addItem(33, 47) val contents = context.Main.code - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -1293,7 +1041,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -1311,153 +1059,12 @@ class RuntimeServerTest ) ) ) - context.receive(7) should contain theSameElementsAs Seq( + context.receive(6) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), context.Main.Update.mainX(contextId), context.Main.Update.mainY(contextId), context.Main.Update.mainZ(contextId), TestMessages.update(contextId, idMain, Constants.INTEGER), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainX), - moduleName, - "x", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainY), - moduleName, - "y", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainZ), - moduleName, - "z", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "foo", - Seq( - Suggestion - .Argument( - "this", - Constants.NUMBER, - false, - false, - None - ), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - Constants.NUMBER, - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idFooY), - moduleName, - "y", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(9, 17), - Suggestion.Position(12, 5) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idFooZ), - moduleName, - "z", - Constants.ANY, - Suggestion.Scope( - Suggestion.Position(9, 17), - Suggestion.Position(12, 5) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ) - ) - ), context.executionComplete(contextId) ) @@ -1505,7 +1112,6 @@ class RuntimeServerTest | IO.println result |""".stripMargin.linesIterator.mkString("\n") val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -1516,7 +1122,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -1534,57 +1140,11 @@ class RuntimeServerTest ) ) ) - context.receive(6) should contain theSameElementsAs Seq( + context.receive(5) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update(contextId, idResult, Constants.INTEGER), TestMessages.update(contextId, idPrintln, Constants.NOTHING), TestMessages.update(contextId, idMain, Constants.NOTHING), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(idResult), - moduleName, - "result", - Constants.ANY, - Suggestion.Scope( - Suggestion.Position(2, 6), - Suggestion.Position(4, 21) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ) - ) - ), context.executionComplete(contextId) ) context.consumeOut shouldEqual List("1337") @@ -1619,10 +1179,14 @@ class RuntimeServerTest val idMain = metadata.addItem(32, 35) val idMainA = metadata.addItem(41, 8) val idMainP = metadata.addItem(54, 12) - val idPie = metadata.addItem(66 + 8, 1) - val idUwu = metadata.addItem(74 + 8, 1) - val idHie = metadata.addItem(82 + 8, 6) - val idXxx = metadata.addItem(102 + 8, 1) + // pie id + metadata.addItem(66 + 8, 1) + // uwu id + metadata.addItem(74 + 8, 1) + // hie id + metadata.addItem(82 + 8, 6) + // Number.x id + metadata.addItem(102 + 8, 1) val code = """from Builtins import all | @@ -1636,7 +1200,6 @@ class RuntimeServerTest |Number.x y = y |""".stripMargin.linesIterator.mkString("\n") val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -1647,7 +1210,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -1665,136 +1228,11 @@ class RuntimeServerTest ) ) ) - context.receive(6) should contain theSameElementsAs Seq( + context.receive(5) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update(contextId, idMainA, Constants.INTEGER), TestMessages.update(contextId, idMainP, Constants.NOTHING), TestMessages.update(contextId, idMain, Constants.NOTHING), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(idMainA), - moduleName, - "a", - Constants.ANY, - Suggestion.Scope( - Suggestion.Position(2, 6), - Suggestion.Position(5, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idPie), - moduleName, - "pie", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idUwu), - moduleName, - "uwu", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idHie), - moduleName, - "hie", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idXxx), - moduleName, - "x", - Seq( - Suggestion.Argument( - "this", - Constants.NUMBER, - false, - false, - None - ), - Suggestion - .Argument("y", Constants.ANY, false, false, None) - ), - Constants.NUMBER, - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) context.consumeOut shouldEqual List("144") @@ -1960,7 +1398,6 @@ class RuntimeServerTest |Number.overloaded arg = arg + 2 |""".stripMargin.linesIterator.mkString("\n") val contents = metadata.appendToCode(code) - val version = contentsVersion(contents) val mainFile = context.writeMain(contents) // create context @@ -1971,7 +1408,7 @@ class RuntimeServerTest // open file context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -1989,7 +1426,7 @@ class RuntimeServerTest ) ) ) - context.receive(7) should contain theSameElementsAs Seq( + context.receive(6) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update(contextId, idMain, Constants.NOTHING), TestMessages.update( @@ -2010,102 +1447,6 @@ class RuntimeServerTest Constants.INTEGER, Api.MethodPointer(moduleName, Constants.NUMBER, "overloaded") ), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(id1), - moduleName, - "x", - Constants.ANY, - Suggestion.Scope( - Suggestion.Position(2, 6), - Suggestion.Position(7, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "overloaded", - Seq( - Suggestion.Argument( - "this", - Constants.TEXT, - false, - false, - None - ), - Suggestion - .Argument("arg", Constants.ANY, false, false, None) - ), - Constants.TEXT, - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "overloaded", - Seq( - Suggestion.Argument( - "this", - Constants.NUMBER, - false, - false, - None - ), - Suggestion - .Argument("arg", Constants.ANY, false, false, None) - ), - Constants.NUMBER, - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) @@ -2278,7 +1619,7 @@ class RuntimeServerTest ) ) ) - context.receive(5) should contain allOf ( + context.receive(4) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update(contextId, xId, Constants.FUNCTION), TestMessages.update(contextId, mainRes, Constants.NOTHING), @@ -2301,13 +1642,12 @@ class RuntimeServerTest | |main = IO.println "I'm a file!" |""".stripMargin - val version = contentsVersion(code) // Create a new file val mainFile = context.writeMain(code) // Open the new file - context.send(Api.Request(Api.OpenFileNotification(mainFile, code, false))) + context.send(Api.Request(Api.OpenFileNotification(mainFile, code, true))) context.receiveNone shouldEqual None context.consumeOut shouldEqual List() @@ -2326,37 +1666,8 @@ class RuntimeServerTest ) ) ) - context.receive(3) should contain theSameElementsAs Seq( + context.receive(2) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - "Test.Main", - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) context.consumeOut shouldEqual List("I'm a file!") @@ -2392,7 +1703,6 @@ class RuntimeServerTest val metadata = new Metadata val idMain = metadata.addItem(7, 2) val code = metadata.appendToCode("main = 84") - val version = contentsVersion(code) context.send(Api.Request(requestId, Api.CreateContextRequest(contextId))) context.receive shouldEqual Some( @@ -2403,15 +1713,7 @@ class RuntimeServerTest val mainFile = context.writeMain(code) // Open the new file - context.send( - Api.Request( - Api.OpenFileNotification( - mainFile, - code, - false - ) - ) - ) + context.send(Api.Request(Api.OpenFileNotification(mainFile, code, true))) context.receiveNone shouldEqual None // Push new item on the stack to trigger the re-execution @@ -2429,38 +1731,9 @@ class RuntimeServerTest ) ) ) - context.receive(4) should contain theSameElementsAs Seq( + context.receive(3) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), TestMessages.update(contextId, idMain, Constants.INTEGER), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - "Test.Main", - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) @@ -2488,7 +1761,6 @@ class RuntimeServerTest val requestId = UUID.randomUUID() val moduleName = "Test.Main" val idMain = context.Main.metadata.addItem(33, 47) - val version = contentsVersion(context.Main.code) val mainFile = context.writeMain(context.Main.code) @@ -2500,13 +1772,7 @@ class RuntimeServerTest // Open the new file context.send( - Api.Request( - Api.OpenFileNotification( - mainFile, - context.Main.code, - false - ) - ) + Api.Request(Api.OpenFileNotification(mainFile, context.Main.code, true)) ) context.receiveNone shouldEqual None @@ -2519,147 +1785,12 @@ class RuntimeServerTest context.send( Api.Request(requestId, Api.PushContextRequest(contextId, item1)) ) - context.receive(7) should contain theSameElementsAs Seq( + context.receive(6) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), context.Main.Update.mainX(contextId), context.Main.Update.mainY(contextId), context.Main.Update.mainZ(contextId), TestMessages.update(contextId, idMain, Constants.INTEGER), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - Some(idMain), - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainX), - moduleName, - "x", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainY), - moduleName, - "y", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainZ), - moduleName, - "z", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "foo", - Seq( - Suggestion - .Argument("this", Constants.NUMBER, false, false, None), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - Constants.NUMBER, - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idFooY), - moduleName, - "y", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(9, 17), - Suggestion.Position(12, 5) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idFooZ), - moduleName, - "z", - Constants.ANY, - Suggestion.Scope( - Suggestion.Position(9, 17), - Suggestion.Position(12, 5) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ) - ) - ), context.executionComplete(contextId) ) @@ -2712,13 +1843,12 @@ class RuntimeServerTest | |main = IO.println "I'm a file!" |""".stripMargin - val version = contentsVersion(code) // Create a new file val mainFile = context.writeMain(code) // Open the new file - context.send(Api.Request(Api.OpenFileNotification(mainFile, code, false))) + context.send(Api.Request(Api.OpenFileNotification(mainFile, code, true))) context.receiveNone shouldEqual None context.consumeOut shouldEqual List() @@ -2737,42 +1867,21 @@ class RuntimeServerTest ) ) ) - context.receive(3) should contain theSameElementsAs Seq( + context.receive(2) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) context.consumeOut shouldEqual List("I'm a file!") - // Modify the file + /* + Modify the file: + """from Builtins import all + | + |Number.lucky = 42 + | + |main = IO.println "I'm a modified!" + |""".stripMargin + */ context.send( Api.Request( Api.EditFileNotification( @@ -2790,43 +1899,7 @@ class RuntimeServerTest ) ) ) - val codeModified = - """from Builtins import all - | - |Number.lucky = 42 - | - |main = IO.println "I'm a modified!" - |""".stripMargin - context.receive(2) should contain theSameElementsAs Seq( - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = contentsVersion(codeModified), - actions = Vector(), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "lucky", - Seq( - Suggestion - .Argument("this", Constants.NUMBER, false, false, None) - ), - Constants.NUMBER, - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), + context.receive(1) should contain theSameElementsAs Seq( context.executionComplete(contextId) ) context.consumeOut shouldEqual List("I'm a modified!") @@ -3946,7 +3019,7 @@ class RuntimeServerTest Api.OpenFileNotification( visualisationFile, context.Visualisation.code, - false + true ) ) ) @@ -3976,74 +3049,12 @@ class RuntimeServerTest context.send( Api.Request(requestId, Api.PushContextRequest(contextId, item1)) ) - context.receive(7) should contain theSameElementsAs Seq( + context.receive(6) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), context.Main.Update.mainX(contextId), context.Main.Update.mainY(contextId), context.Main.Update.mainZ(contextId), TestMessages.update(contextId, idMain, Constants.INTEGER), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = visualisationFile, - version = contentsVersion(context.Visualisation.code), - actions = - Vector(Api.SuggestionsDatabaseAction.Clean("Test.Visualisation")), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - "Test.Visualisation", - "encode", - List( - Suggestion.Argument( - "this", - "Test.Visualisation", - false, - false, - None - ), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - "Test.Visualisation", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - "Test.Visualisation", - "incAndEncode", - List( - Suggestion.Argument( - "this", - "Test.Visualisation", - false, - false, - None - ), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - "Test.Visualisation", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) @@ -4122,7 +3133,7 @@ class RuntimeServerTest Api.OpenFileNotification( visualisationFile, context.Visualisation.code, - false + true ) ) ) @@ -4152,73 +3163,11 @@ class RuntimeServerTest context.send( Api.Request(requestId, Api.PushContextRequest(contextId, item1)) ) - context.receive(6) should contain theSameElementsAs Seq( + context.receive(5) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), context.Main.Update.mainX(contextId), context.Main.Update.mainY(contextId), context.Main.Update.mainZ(contextId), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = visualisationFile, - version = contentsVersion(context.Visualisation.code), - actions = - Vector(Api.SuggestionsDatabaseAction.Clean("Test.Visualisation")), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - "Test.Visualisation", - "encode", - List( - Suggestion.Argument( - "this", - "Test.Visualisation", - false, - false, - None - ), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - "Test.Visualisation", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - "Test.Visualisation", - "incAndEncode", - List( - Suggestion.Argument( - "this", - "Test.Visualisation", - false, - false, - None - ), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - "Test.Visualisation", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), context.executionComplete(contextId) ) @@ -4303,7 +3252,6 @@ class RuntimeServerTest it should "emit visualisation update without value update" in { val contents = context.Main.code - val version = contentsVersion(contents) val moduleName = "Test.Main" val mainFile = context.writeMain(contents) val visualisationFile = @@ -4319,13 +3267,13 @@ class RuntimeServerTest Api.OpenFileNotification( visualisationFile, context.Visualisation.code, - false + true ) ) ) context.receiveNone shouldEqual None context.send( - Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + Api.Request(Api.OpenFileNotification(mainFile, contents, true)) ) context.receiveNone shouldEqual None @@ -4345,208 +3293,11 @@ class RuntimeServerTest Api.Request(requestId, Api.PushContextRequest(contextId, item1)) ) - context.receive(7) should contain theSameElementsAs Seq( + context.receive(5) should contain theSameElementsAs Seq( Api.Response(requestId, Api.PushContextResponse(contextId)), context.Main.Update.mainX(contextId), context.Main.Update.mainY(contextId), context.Main.Update.mainZ(contextId), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = visualisationFile, - version = contentsVersion(context.Visualisation.code), - actions = - Vector(Api.SuggestionsDatabaseAction.Clean("Test.Visualisation")), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - "Test.Visualisation", - "encode", - List( - Suggestion.Argument( - "this", - "Test.Visualisation", - false, - false, - None - ), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - "Test.Visualisation", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - "Test.Visualisation", - "incAndEncode", - List( - Suggestion.Argument( - "this", - "Test.Visualisation", - false, - false, - None - ), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - "Test.Visualisation", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ), - Api.Response( - Api.SuggestionsDatabaseModuleUpdateNotification( - file = mainFile, - version = version, - actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), - updates = Tree.Root( - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "main", - Seq( - Suggestion - .Argument("this", "Test.Main", false, false, None) - ), - "Test.Main", - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainX), - moduleName, - "x", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainY), - moduleName, - "y", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idMainZ), - moduleName, - "z", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(3, 6), - Suggestion.Position(8, 0) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Method( - None, - moduleName, - "foo", - Seq( - Suggestion - .Argument("this", Constants.NUMBER, false, false, None), - Suggestion - .Argument("x", Constants.ANY, false, false, None) - ), - Constants.NUMBER, - Constants.ANY, - None - ), - Api.SuggestionAction.Add() - ), - Vector( - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idFooY), - moduleName, - "y", - Constants.ANY, - Suggestion - .Scope( - Suggestion.Position(9, 17), - Suggestion.Position(12, 5) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ), - Tree.Node( - Api.SuggestionUpdate( - Suggestion.Local( - Some(context.Main.idFooZ), - moduleName, - "z", - Constants.ANY, - Suggestion.Scope( - Suggestion.Position(9, 17), - Suggestion.Position(12, 5) - ) - ), - Api.SuggestionAction.Add() - ), - Vector() - ) - ) - ) - ) - ) - ) - ), context.executionComplete(contextId) ) diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala index 1c2010ff673f..23c87345f2e9 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala @@ -668,4 +668,152 @@ class SuggestionUpdatesTest context.consumeOut shouldEqual List("51") } + it should "index overloaded functions" in { + val contextId = UUID.randomUUID() + val requestId = UUID.randomUUID() + val moduleName = "Test.Main" + + val contents = + """from Builtins import all + | + |main = + | x = 15.overloaded 1 + | "foo".overloaded 2 + | 10.overloaded x + | Nothing + | + |Text.overloaded arg = arg + 1 + |Number.overloaded arg = arg + 2 + |""".stripMargin.linesIterator.mkString("\n") + val version = contentsVersion(contents) + val mainFile = context.writeMain(contents) + + // create context + context.send(Api.Request(requestId, Api.CreateContextRequest(contextId))) + context.receive shouldEqual Some( + Api.Response(requestId, Api.CreateContextResponse(contextId)) + ) + + // open file + context.send( + Api.Request(Api.OpenFileNotification(mainFile, contents, false)) + ) + context.receiveNone shouldEqual None + + // push main + context.send( + Api.Request( + requestId, + Api.PushContextRequest( + contextId, + Api.StackItem.ExplicitCall( + Api.MethodPointer(moduleName, "Test.Main", "main"), + None, + Vector() + ) + ) + ) + ) + context.receive(3) should contain theSameElementsAs Seq( + Api.Response(requestId, Api.PushContextResponse(contextId)), + Api.Response( + Api.SuggestionsDatabaseModuleUpdateNotification( + file = mainFile, + version = version, + actions = Vector(Api.SuggestionsDatabaseAction.Clean(moduleName)), + updates = Tree.Root( + Vector( + Tree.Node( + Api.SuggestionUpdate( + Suggestion.Method( + None, + moduleName, + "main", + Seq( + Suggestion + .Argument("this", "Test.Main", false, false, None) + ), + "Test.Main", + Constants.ANY, + None + ), + Api.SuggestionAction.Add() + ), + Vector( + Tree.Node( + Api.SuggestionUpdate( + Suggestion.Local( + None, + moduleName, + "x", + Constants.ANY, + Suggestion.Scope( + Suggestion.Position(2, 6), + Suggestion.Position(7, 0) + ) + ), + Api.SuggestionAction.Add() + ), + Vector() + ) + ) + ), + Tree.Node( + Api.SuggestionUpdate( + Suggestion.Method( + None, + moduleName, + "overloaded", + Seq( + Suggestion.Argument( + "this", + Constants.TEXT, + false, + false, + None + ), + Suggestion + .Argument("arg", Constants.ANY, false, false, None) + ), + Constants.TEXT, + Constants.ANY, + None + ), + Api.SuggestionAction.Add() + ), + Vector() + ), + Tree.Node( + Api.SuggestionUpdate( + Suggestion.Method( + None, + moduleName, + "overloaded", + Seq( + Suggestion.Argument( + "this", + Constants.NUMBER, + false, + false, + None + ), + Suggestion + .Argument("arg", Constants.ANY, false, false, None) + ), + Constants.NUMBER, + Constants.ANY, + None + ), + Api.SuggestionAction.Add() + ), + Vector() + ) + ) + ) + ) + ), + context.executionComplete(contextId) + ) + } + } From cd2592cd96ad6715cf13aa7e4da467e0c792775a Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Sat, 13 Mar 2021 14:53:31 +0300 Subject: [PATCH 5/6] test: builtins indexing --- .../instrument/StdlibRuntimeServerTest.scala | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/StdlibRuntimeServerTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/StdlibRuntimeServerTest.scala index b010f1b26a44..dcafee3f8026 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/StdlibRuntimeServerTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/StdlibRuntimeServerTest.scala @@ -116,11 +116,12 @@ class StdlibRuntimeServerTest msg: Api.Response, timeout: Long ): List[Api.Response] = { - Iterator + val receivedUntil = Iterator .continually(receive(timeout)) - .takeWhile(received => received.isDefined && received != Some(msg)) + .takeWhile(received => received.isDefined && !received.contains(msg)) .flatten .toList + receivedUntil :+ msg } def consumeOut: List[String] = { @@ -185,17 +186,27 @@ class StdlibRuntimeServerTest context.executionComplete(contextId), timeout = 30 ) - response should contain( - Api.Response(requestId, Api.PushContextResponse(contextId)) + response should contain allOf ( + Api.Response(requestId, Api.PushContextResponse(contextId)), + context.executionComplete(contextId) ) - val collected = response.collect { + val suggestions = response.collect { case Api.Response( None, Api.SuggestionsDatabaseModuleUpdateNotification(_, _, as, xs) ) => (xs.nonEmpty || as.nonEmpty) shouldBe true } - collected.isEmpty shouldBe false + suggestions.isEmpty shouldBe false + + val builtinsSuggestions = response.collect { + case Api.Response( + None, + Api.SuggestionsDatabaseModuleUpdateNotification(file, _, as, xs) + ) if file.getPath.contains("Builtins") => + (xs.nonEmpty || as.nonEmpty) shouldBe true + } + builtinsSuggestions.length shouldBe 1 context.consumeOut shouldEqual List("Hello World!") } From f0fff96e32e50055b685737c710f7ba815ea9f34 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Sat, 13 Mar 2021 15:04:05 +0300 Subject: [PATCH 6/6] test: rename test suites --- .../{ExpressionErrorsTest.scala => RuntimeErrorsTest.scala} | 2 +- .../{StdlibRuntimeServerTest.scala => RuntimeStdlibTest.scala} | 2 +- ...tionUpdatesTest.scala => RuntimeSuggestionUpdatesTest.scala} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/{ExpressionErrorsTest.scala => RuntimeErrorsTest.scala} (99%) rename engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/{StdlibRuntimeServerTest.scala => RuntimeStdlibTest.scala} (99%) rename engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/{SuggestionUpdatesTest.scala => RuntimeSuggestionUpdatesTest.scala} (99%) diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala similarity index 99% rename from engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala rename to engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala index dc39de7b2b63..94e0bd5722ff 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/ExpressionErrorsTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala @@ -22,7 +22,7 @@ import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @scala.annotation.nowarn("msg=multiarg infix syntax") -class ExpressionErrorsTest +class RuntimeErrorsTest extends AnyFlatSpec with Matchers with BeforeAndAfterEach { diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/StdlibRuntimeServerTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeStdlibTest.scala similarity index 99% rename from engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/StdlibRuntimeServerTest.scala rename to engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeStdlibTest.scala index dcafee3f8026..15b4e2b6f6ec 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/StdlibRuntimeServerTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeStdlibTest.scala @@ -18,7 +18,7 @@ import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @scala.annotation.nowarn("msg=multiarg infix syntax") -class StdlibRuntimeServerTest +class RuntimeStdlibTest extends AnyFlatSpec with Matchers with BeforeAndAfterEach diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeSuggestionUpdatesTest.scala similarity index 99% rename from engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala rename to engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeSuggestionUpdatesTest.scala index 23c87345f2e9..003a19d189fc 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/SuggestionUpdatesTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeSuggestionUpdatesTest.scala @@ -21,7 +21,7 @@ import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @scala.annotation.nowarn("msg=multiarg infix syntax") -class SuggestionUpdatesTest +class RuntimeSuggestionUpdatesTest extends AnyFlatSpec with Matchers with BeforeAndAfterEach {