-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separating instrument related files into runtime-instrument-common pr…
…oject (#6992)
- Loading branch information
1 parent
876ecfc
commit e6652b8
Showing
84 changed files
with
153 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
70 changes: 70 additions & 0 deletions
70
...ument-common/src/main/scala/org/enso/interpreter/instrument/service/InteractiveMode.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package org.enso.interpreter.service | ||
|
||
import com.typesafe.scalalogging.Logger | ||
import org.enso.cli.task.{ProgressNotification, TaskProgress} | ||
import org.enso.distribution.ProgressAndLockNotificationForwarder | ||
import org.enso.editions.{LibraryName, LibraryVersion} | ||
import org.enso.pkg.QualifiedName | ||
import org.enso.polyglot.runtime.Runtime.{Api, ApiResponse} | ||
import org.enso.interpreter.instrument.NotificationHandler | ||
import org.enso.interpreter.instrument.ProgressNotificationTranslator | ||
import org.enso.interpreter.instrument.Endpoint | ||
|
||
import java.nio.file.Path | ||
|
||
/** A [[NotificationHandler]] for interactive mode, which forwards the | ||
* notifications to the Language Server, which then should forward them to | ||
* the IDE. | ||
*/ | ||
private class InteractiveMode(endpoint: Endpoint) | ||
extends ProgressAndLockNotificationForwarder | ||
with NotificationHandler { | ||
private val logger = Logger[InteractiveMode] | ||
|
||
private def sendMessage(message: ApiResponse): Unit = { | ||
val response = Api.Response(None, message) | ||
endpoint.sendToClient(response) | ||
} | ||
|
||
/** @inheritdoc */ | ||
override def addedLibrary( | ||
libraryName: LibraryName, | ||
libraryVersion: LibraryVersion, | ||
location: Path | ||
): Unit = { | ||
sendMessage( | ||
Api.LibraryLoaded( | ||
namespace = libraryName.namespace, | ||
name = libraryName.name, | ||
version = libraryVersion.toString, | ||
location = location.toFile | ||
) | ||
) | ||
endpoint.sendToSelf( | ||
Api.Request( | ||
Api.DeserializeLibrarySuggestions(libraryName) | ||
) | ||
) | ||
} | ||
|
||
/** @inheritdoc */ | ||
override def serializeModule(module: QualifiedName): Unit = | ||
endpoint.sendToSelf( | ||
Api.Request(Api.SerializeModule(module)) | ||
) | ||
|
||
/** @inheritdoc */ | ||
override def trackProgress(message: String, task: TaskProgress[_]): Unit = { | ||
logger.info(message) | ||
super.trackProgress(message, task) | ||
} | ||
|
||
override def sendProgressNotification( | ||
notification: ProgressNotification | ||
): Unit = sendMessage( | ||
ProgressNotificationTranslator.translate( | ||
"compiler/downloadingDependencies", | ||
notification | ||
) | ||
) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
engine/runtime/src/main/java/org/enso/compiler/context/SimpleUpdate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.enso.compiler.context; | ||
|
||
import org.enso.compiler.core.IR; | ||
import org.enso.text.editing.model.TextEdit; | ||
|
||
/** | ||
* Simple editing change description. | ||
* | ||
* @param ir the current literal | ||
* @param edit the editor change | ||
* @param newIr the new literal | ||
*/ | ||
public record SimpleUpdate( | ||
IR.Literal ir, | ||
TextEdit edit, | ||
IR.Literal newIr | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.