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

Embedded Langauge Support in Typescript #1594

Open
foopis23 opened this issue Sep 8, 2024 · 1 comment
Open

Embedded Langauge Support in Typescript #1594

foopis23 opened this issue Sep 8, 2024 · 1 comment

Comments

@foopis23
Copy link

foopis23 commented Sep 8, 2024

I'm working on a library to write data packs in Typescript (https://github.com/foopis23/ts-datapacks). It's helpful to generate long command files using a language many people already know. On top of that, I believe the auto-complete and type-safety features make it easier for beginners.

One feature I have been looking into is getting mcfunction syntax highlighting and language features to work inside embedded strings. Before I learned how to do it and built my own vs-code extension, I figured I would reach out and suggest it as a feature here since it would be convenient to just put people towards this extension instead of making my own and then probably having to suggest using both extensions.

My library uses tag functions to define commands. See the following for an example

const name = "foopis23";
const commandStr = command`say "Hello, ${name}!"`;

I figured it would be a similar implementation to how SQL language features now to highlight anything instead of a tag function named SQL.

The last thing I will say is that, if you guys are open to this, I'm open to changing the tag function name. My library is early in development and nothing is considered stable yet, so I could rename it to like, mcfunc or mc or something like that to make it specific to Minecraft.

@foopis23
Copy link
Author

foopis23 commented Sep 9, 2024

If this is a feature you guys are interested in, I'd be happy to take a crack at implementing it.

That said, I would probably need someone to point towards to right area to implement it. I looked at the source code and noticed it is a lot more involved then the simple examples on the vscode docs. Still pretty new to extension development so I haven't really worked on anything larger than a couple of files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant