Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zed Support #458

Closed
4 tasks done
XiNiHa opened this issue Jul 16, 2024 · 12 comments
Closed
4 tasks done

Zed Support #458

XiNiHa opened this issue Jul 16, 2024 · 12 comments
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@XiNiHa
Copy link

XiNiHa commented Jul 16, 2024

Initial checklist

Problem

Zed is a VSCode-like code editor that has recently gained some popularity. However, it currently doesn't have MDX support, either in first-party integrations or third-party extensions. (see zed-industries/extensions#203)

Solution

Creating an extension for Zed would have a great impact here. Since many Zed extensions work with the LSP protocol, it'd be definitely possible to integrate the MDX language server with Zed, especially considering that other Volar-based language servers like Vue and Astro already support Zed.

Alternatives

Recommend users to stay on VSCode and do nothing

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jul 16, 2024
@remcohaszing
Copy link
Member

It’s cool to hear people want this. I’m not sure if this repo is the right place to maintain Zed integration though. Perhaps it’s better if Zed adds their own integration. See zed-industries/extensions#203 (comment).

This is not a definite no. It could be nice to support this from the MDX side if Zed doesn’t want to maintain it.

@remcohaszing remcohaszing added 🙉 open/needs-info This needs some more info 💬 type/discussion This is a request for comments labels Jul 16, 2024
Copy link
Contributor

github-actions bot commented Jul 16, 2024

Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:

  • Spend time framing the issue! The more time you put into it, the more we will
  • Often, maintainers respond with why for several back and forths; rubber duck debugging might help avoid that
  • Folks posting issues sometimes fall for xy problems: asking for a certain solution instead of raising the root problem

Thanks,
— bb

@wooorm
Copy link
Member

wooorm commented Jul 16, 2024

👍 on what remco says there.
I’d also say it’s probably easier to maintain by someone who is familiar with and actively using zed, as that’s where most of the complexity is and that’s where a lot of the activity/instability comes from.
The MDX side of things is more stable: similar to how any other language is added indeed. LSP / TextMate grammar.

@XiNiHa
Copy link
Author

XiNiHa commented Jul 16, 2024

By the way, Zed uses TreeSitter grammars instead of TM, although that wouldn't matter that much AFAIK since we provide the language server anyways.

@wooorm
Copy link
Member

wooorm commented Jul 16, 2024

tree-sitter is a bit different. I looked into it once. I’ve thought about making a TS grammar when I made the TM grammar. Though, it might not be possible to properly highlight MDX or markdown with TS. See https://github.com/davidmh/mdx.nvim. And also https://github.com/tree-sitter-grammars/tree-sitter-markdown#goals.

@XiNiHa
Copy link
Author

XiNiHa commented Jul 16, 2024

I thought that it's possible to provide syntax highlighting just with a language server. Isn't that true? If not a TreeSitter grammar should be worked on for sure 🥲

@remcohaszing
Copy link
Member

LSP supports semantic tokens, which can be used to enhance syntax highlighting based on context, for example:

// Is Thing a class? function? interface? This can be determined using semantic tokens
import { Thing } from 'module'

But basic syntax highlighting happens in a grammar such as TextMate, Monarch, or TreeSitter.

@wooorm
Copy link
Member

wooorm commented Jul 16, 2024

Can only TreeSitter syntaxes expose those semantic tokens? Could they be exposed from TextMate grammars? 🤔

@remcohaszing
Copy link
Member

No, the language server exposes them. The point is, yes, the language server enhances syntax highlighting a bit, so you may find some info about that when you search a bit. But it doesn’t provide most highlighting, that’s something for grammars to provide.

@wooorm
Copy link
Member

wooorm commented Jul 16, 2024

right 👍 it just feels a bit out of place to me for LSP to do that

@remcohaszing remcohaszing added 👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on and removed 🙉 open/needs-info This needs some more info 💬 type/discussion This is a request for comments 🤞 phase/open Post is being triaged manually labels Sep 8, 2024
@github-actions github-actions bot closed this as completed Sep 8, 2024

This comment was marked as resolved.

@remcohaszing
Copy link
Member

The Zed team is free to reach out if they want to implement MDX support, but it’s not actionable for us right now.

@remcohaszing remcohaszing closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

3 participants