#VS Code Language Extension Project - Hover Issues

13 messages · Page 1 of 1 (latest)

simple mulch
#

I am creating a VS Code extension and I made it highlight some text for the language Tableau uses to create custom actions. It looks like some of the guides use TS and some use JS. A lot of examples use TS. I am assuming this is TS but I could be wrong. Has anyone worked on the same type of extension that knows where these types of interfaces modules go?

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover

export interface HoverClientCapabilities {
    /**
     * Whether hover supports dynamic registration.
     */
    dynamicRegistration?: boolean;

    /**
     * Client supports the follow content formats if the content
     * property refers to a `literal of type MarkupContent`.
     * The order describes the preferred format of the client.
     */
    contentFormat?: MarkupKind[];
}

Here's an example of the code for a sample LSP extension:https://github.com/microsoft/vscode-extension-samples/tree/main/lsp-embedded-language-service

GitHub

Sample code illustrating the VS Code extension API. - microsoft/vscode-extension-samples

nocturne torrent
#

when you ask where do they "go", what do you mean exactly?

#

i've never written a VSCode extension before but that specification makes it sound like HoverClientCapabilities is a description of the payload for a particular language server API request

simple mulch
nocturne torrent
#

are you asking if you need to copy/paste that interface into your extension's codebase? if so i think the answer is no

simple mulch
#

Not necessarily that, but if I were to paste it, where would I paste it?

#

I think since I started as a simple syntax highlighter I need to create the actual location for the server & client stuff like in the example

nocturne torrent
#

ah, maybe i'm interpreting your question more specifically than you meant. you can put types anywhere you want in TS. they get totally erased by the compiler and are irrelevant at runtime. if you're asking more generally how you should organize the modules in a VSCode extension i probably can't help you since i don't have experience there. if it were me i'd probably start by cloning that sample repo and then iterating on the code there until it does what i want

simple mulch
#

Okay, thanks! After thinking about some of your questions I think that's probably true and that this isn't probably not a great place for this question anyways.

nocturne torrent
#

yeah, i dunno if there's a discord server specifically for VSCode extension authors but that might be the place to go

#

(the command is !close, FYI)

simple mulch
#

Haha thank you! I have looked for a discord for that but the only ones I find are basicially AI bot farms thonk