Skip to content

Using the protocol for other languages (in particular python)  #61

@Nova38

Description

@Nova38

I find twoslash enabled doc to be really helpful when reading typescript projects that use them in their docs. I have been working on a few personal projects that use shiki for syntax highlighting some python files. I saw that there was a twoslash protocol that was created (#17 (comment)) to allow for things other than the typescript language server to generate the info that twoslash needs to render it. I was wondering what the steps would be to get the data generated into twoslash for rendering in to shiki?

Also if i wanted to include the docstrings for the nodes would I need to convert them into the jsdoc equivalents or what format do the strings of the types bellow need to be?

export interface NodeHover extends NodeBase {
type: 'hover'
/** The string content of the node this represents (mainly for debugging) */
target: string
/** The base LSP response (the type) */
text: string
/** Attached JSDoc info */
docs?: string
/** JSDoc tags */
tags?: [name: string, text: string | undefined][]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions