Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

How to use other languages beside JS / TS? #119

@johnnyreilly

Description

@johnnyreilly

Hey all!

I'm confused. According to the docs, Twoslash:

Supports all possible languages available on the VS Code extension marketplace. That’s over 200 languages. All you need is a .tmlanguage file for anything not shipped with Shiki.

However, if I try and use something like C# I see this error:

image

Received csharp but Twoslash only accepts: js,javascript,ts,typescript,tsx,jsx,json,jsn

In this case Shiki supports csharp:

  ['csharp', 'https://github.com/dotnet/csharp-tmLanguage/blob/main/grammars/csharp.tmLanguage'],

https://github.com/shikijs/shiki/blob/a29e1991b2e24c8ebbf53112a14f80c52a338587/scripts/grammarSources.ts#L158

So I'm a little puzzled as to why this doesn't work? Am I doing something wrong?

You can try this out by using the steps in johnnyreilly/blog.johnnyreilly.com#95 and going to http://localhost:3000/2021/07/01/c-sharp-9-azure-functions-in-process

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