diff --git a/internal/util-interface/src/main/java/xsbti/Action.java b/internal/util-interface/src/main/java/xsbti/Action.java new file mode 100644 index 0000000000..6bfc128266 --- /dev/null +++ b/internal/util-interface/src/main/java/xsbti/Action.java @@ -0,0 +1,32 @@ +/* + * sbt + * Copyright 2011 - 2018, Lightbend, Inc. + * Copyright 2008 - 2010, Mark Harrah + * Licensed under Apache License 2.0 (see LICENSE) + */ + +package xsbti; + +import java.util.Optional; + +/** + * An Action is very miminal representation of a `CodeAction` in the LSP protocol. + * + *
However it only focuses on the actual title, description, and edit, leaving it up to the
+ * language server to communicate with the client and put together a proper codeAction in accordance
+ * to client capabilities.
+ *
+ * @see `CodeAction`
+ */
+public interface Action {
+
+ /** Title of the action that will be shown to the user client side. */
+ String title();
+
+ /** Optional description that may be shown to the user client side to explain the action. */
+ Optional For example given the following code:
+ *
+ * NOTE: That instead of a `Range` we use the internal [[xsbti.Position]].
+ *
+ * @see `TextEdit`
+ */
+public interface TextEdit {
+
+ /** The position this edit will be applied to. */
+ Position position();
+
+ /** The next text that will be inserted into the given [[TextEdit.position]]. */
+ String newText();
+}
diff --git a/internal/util-interface/src/main/java/xsbti/WorkspaceEdit.java b/internal/util-interface/src/main/java/xsbti/WorkspaceEdit.java
new file mode 100644
index 0000000000..438e38aad2
--- /dev/null
+++ b/internal/util-interface/src/main/java/xsbti/WorkspaceEdit.java
@@ -0,0 +1,27 @@
+/*
+ * sbt
+ * Copyright 2011 - 2018, Lightbend, Inc.
+ * Copyright 2008 - 2010, Mark Harrah
+ * Licensed under Apache License 2.0 (see LICENSE)
+ */
+
+package xsbti;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * A minimal representatin of the `WorkspaceEdit` found in the LSP protocol.
+ *
+ * However it only supports the minimal `changes` to ensure the fixes will work with all clients.
+ *
+ * NOTE: In the future this may be expanded to handle resource operations via `documentChanges`.
+ *
+ * @see `WorkspaceEdit`
+ */
+public interface WorkspaceEdit {
+
+ /** List of [[xsbti.FileChanges]] that belong to this WorkspaceEdit. */
+ List
+ * trait Example:
+ * def foo(): Unit
+ * def bar(): Unit
+ *
+ * class MyExample extends Example
+ *
+ *
+ * You could expect this to have multiple actions attatched:
+ *
+ *
+ *
+ */
+ default List