-
Notifications
You must be signed in to change notification settings - Fork 333
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
fix: obey hover markup kind
capability
#6303
Conversation
metals/src/main/scala/scala/meta/internal/metals/MetalsSymbolSearch.scala
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/InlayHintResolveProvider.scala
Outdated
Show resolved
Hide resolved
metals/src/main/scala/scala/meta/internal/metals/MetalsSymbolSearch.scala
Show resolved
Hide resolved
* Returns the type of the expression at the given position along with the | ||
* symbol of the referenced symbol. | ||
*/ | ||
public CompletableFuture<Optional<HoverSignature>> hover(OffsetParams params, ContentType contentType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we instead of adding a new method add it to PresentationCompilerConfig ?
@@ -29,22 +30,23 @@ import scala.meta.pc.SymbolDocumentation | |||
* Handles both javadoc and scaladoc. | |||
*/ | |||
class Docstrings(index: GlobalSymbolIndex) { | |||
val cache = new TrieMap[String, SymbolDocumentation]() | |||
val cache = new TrieMap[(String, ContentType), SymbolDocumentation]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val cache = new TrieMap[(String, ContentType), SymbolDocumentation]() | |
val cache = new TrieMap[Content, SymbolDocumentation]() |
Maybe create a case class for it? Or:
sealed trait Content extends Any
class Markdown(val text: String) extends AnyVal with Content
class Plain(val text: String) extends AnyVal with Content
def toPlaintext(b: Body): String = | ||
Option(b).map(body => printBlocks(body.blocks)).mkString("\n") | ||
|
||
def toPlaintext(c: Comment, docstring: String): String = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance to share some of MarkdownGenerator implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! One minor thing, otherwise we are good to merge.
class Plain(val text: String) extends AnyVal with Content | ||
|
||
object Content { | ||
def from(text: String, contentType: ContentType): AnyVal with Content = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def from(text: String, contentType: ContentType): AnyVal with Content = | |
def from(text: String, contentType: ContentType): Content = |
would be enough
Changes from: - scalameta/metals#6225 - scalameta/metals#6236 - scalameta/metals#6241 - scalameta/metals#6303 - scalameta/metals#6308 [Cherry-picked 1cdf99f]
Changes from: - scalameta/metals#6225 - scalameta/metals#6236 - scalameta/metals#6241 - scalameta/metals#6303 - scalameta/metals#6308 [Cherry-picked 1cdf99f]
resolves: #6293