Struct languageserver_types::MarkupContent [−][src]
pub struct MarkupContent { pub kind: MarkupKind, pub value: String, }
A MarkupContent
literal represents a string value which content is interpreted base on its
kind flag. Currently the protocol supports plaintext
and markdown
as markup kinds.
If the kind is markdown
then the value can contain fenced code blocks like in GitHub issues.
See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
Here is an example how such a string can be constructed using JavaScript / TypeScript:
let markdown: MarkdownContent = {
kind: MarkupKind.Markdown,
value: [
'# Header',
'Some text',
'```typescript',
'someCode();',
'```'
].join('\n')
};
Please Note that clients might sanitize the return markdown. A client could decide to remove HTML from the markdown to avoid script execution.
Fields
kind: MarkupKind
value: String
Trait Implementations
impl Debug for MarkupContent
[src]
impl Debug for MarkupContent
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for MarkupContent
[src]
impl Eq for MarkupContent
impl PartialEq for MarkupContent
[src]
impl PartialEq for MarkupContent
fn eq(&self, other: &MarkupContent) -> bool
[src]
fn eq(&self, other: &MarkupContent) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MarkupContent) -> bool
[src]
fn ne(&self, other: &MarkupContent) -> bool
This method tests for !=
.
impl Clone for MarkupContent
[src]
impl Clone for MarkupContent
fn clone(&self) -> MarkupContent
[src]
fn clone(&self) -> MarkupContent
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for MarkupContent
impl Send for MarkupContent
impl Sync for MarkupContent
impl Sync for MarkupContent