-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Somewhat working version of range hover action
- Loading branch information
1 parent
9f8ccde
commit dff09c0
Showing
13 changed files
with
420 additions
and
104 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
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
17 changes: 17 additions & 0 deletions
17
metals/src/main/scala/scala/meta/internal/metals/HoverExtension.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,17 @@ | ||
package scala.meta.internal.metals | ||
|
||
import javax.annotation.Nullable | ||
|
||
import org.eclipse.lsp4j.Position | ||
import org.eclipse.lsp4j.Range | ||
import org.eclipse.lsp4j.TextDocumentIdentifier | ||
|
||
case class HoverExtParams( | ||
textDocument: TextDocumentIdentifier, | ||
@Nullable position: Position = null, | ||
@Nullable range: Range = null | ||
) { | ||
def getPosition: Position = | ||
if (position != null) position | ||
else range.getStart() | ||
} |
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
13 changes: 13 additions & 0 deletions
13
mtags-interfaces/src/main/java/scala/meta/pc/RangeParams.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,13 @@ | ||
package scala.meta.pc; | ||
|
||
/** | ||
* Parameters for a presentation compiler request at a given offset in a single source file. | ||
*/ | ||
public interface RangeParams extends OffsetParams { | ||
|
||
/** | ||
* The character offset of the request. | ||
*/ | ||
int endOffset(); | ||
|
||
} |
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.