[][src]Struct lsp_types::MarkupContent

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: MarkupKindvalue: String

Trait Implementations

impl Clone for MarkupContent[src]

impl Debug for MarkupContent[src]

impl<'de> Deserialize<'de> for MarkupContent[src]

impl Eq for MarkupContent[src]

impl PartialEq<MarkupContent> for MarkupContent[src]

impl Serialize for MarkupContent[src]

impl StructuralEq for MarkupContent[src]

impl StructuralPartialEq for MarkupContent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.