Skip to content

Added support for Carbon Syntax Highlighting #8908

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

Merged
merged 7 commits into from
Apr 20, 2024
Merged

Added support for Carbon Syntax Highlighting #8908

merged 7 commits into from
Apr 20, 2024

Conversation

RohanVashisht1234
Copy link
Contributor

@RohanVashisht1234 RohanVashisht1234 commented Apr 9, 2024

@packagecontrol-bot

  • I'm the package's author and/or maintainer.
  • I have have read the docs.
  • I have tagged a release with a semver version number.
  • My package repo has a description and a README describing what it's for and how to use it.
  • My package doesn't add context menu entries. *
  • My package doesn't add key bindings. **
  • Any commands are available via the command palette.
  • Preferences and keybindings (if any) are listed in the menu and the command palette, and open in split view.
  • If my package is a syntax it doesn't also add a color scheme. ***
  • If my package is a syntax it is named after the language it supports (without suffixes like "syntax" or "highlighting").
  • I use .gitattributes to exclude files from the package: images, test files, sublime-project/workspace.

My package is a syntax highlighter for the carbon programming language

There are no packages like it in Package Control.

@braver
Copy link
Collaborator

braver commented Apr 13, 2024

Please check off all the items in the list, it’s there for a reason ;)

https://github.com/wbond/package_control_channel/blob/master/.github/PULL_REQUEST_TEMPLATE.md

@RohanVashisht1234
Copy link
Contributor Author

Ok, I'm adding them, and also making a new repo for this.

@RohanVashisht1234
Copy link
Contributor Author

@packagecontrol-bot please check this PR for inclusion

@RohanVashisht1234
Copy link
Contributor Author

😂😂😂😂 I don't think package control bot works this way, How to use package control bot?

@RohanVashisht1234
Copy link
Contributor Author

Um, can you please tell me why is this happening? and how to fix it?

@RohanVashisht1234
Copy link
Contributor Author

RohanVashisht1234 commented Apr 14, 2024

Is the error fixed now?

@braver
Copy link
Collaborator

braver commented Apr 14, 2024

Yeah, uh, where to start 😅 Don't take this the wrong way, but there is some work left to do for this to work.

I have tagged a release with a semver version number.

You did not, or forgot to push a tag.

That's the main issue, without a tag, package control can't download your package, and not test it, resulting in the error you're seeing here.

If my package is a syntax it is named after the language it supports (without suffixes like "syntax" or "highlighting").

If your package support the Carbon Language (I'm guessing that's the one), please just call it "Carbon Language". A language support package in Sublime Text unlocks not just "colors" but also goto definition, symbol lists, folding, completion, etc. etc. It's not a "code colorizer". That's why we have that instruction in there: just name your package after the language and don't try to put all its features in the name.

Futhermore, don't put a package.json in your package. Your package description in this PR right here, nothing else is needed.

Finally, your package contains various JSON files but no syntax files that Sublime Text understands. The tmLanguage json could be converted into a tmLanguage file probably. But instead of going down that (admittedly quite ancient) route, why not get with the times and write your syntax using Sublime Text's sublime-syntax format? As for the syntax itself it looks basic, but workable. But many scopes are missing the .carbon suffix.

It almost looks like you're trying to create a VS Code package here? Or maybe converting from one?

@RohanVashisht1234
Copy link
Contributor Author

Yes, you are correct I was trying to convert a vscode package to sublime text package. My package is just a code colorizer "a syntax highligher" it doesn't provide any lsp/goes to definitions.
Yes, and I'll convert the .json to sublime-syntax

@braver
Copy link
Collaborator

braver commented Apr 14, 2024

it doesn't provide any lsp/goes to definitions

Yes it does actually. Sublime Text uses your syntax to provide those features. Not via an LSP, but still. That’s my point, in ST “code colorizer” really is a misnomer.

@RohanVashisht1234
Copy link
Contributor Author

RohanVashisht1234 commented Apr 14, 2024

yes, is there a way to test this locally at my computer?
Also, can you please provide me with a demo kind of repo? for sublime-syntax? because I want to place my thing inside src directory

@braver
Copy link
Collaborator

braver commented Apr 14, 2024

Sure, anything you place in the Packages directory are immediately loaded and hot-reloaded, so you can easily develop that way.

Relevant documentation, including examples:

Help can be got at the forum and Discord channel.

@RohanVashisht1234
Copy link
Contributor Author

RohanVashisht1234 commented Apr 18, 2024

Ok braver, I have made some changes, please tell me if this needs any corrections.

@RohanVashisht1234
Copy link
Contributor Author

@packagecontrol-bot

@RohanVashisht1234
Copy link
Contributor Author

Idk why @packagecontrol-bot is giving these errors.

@braver
Copy link
Collaborator

braver commented Apr 19, 2024

Still this:

You did not, or forgot to push a tag.

@RohanVashisht1234
Copy link
Contributor Author

@packagecontrol-bot

@RohanVashisht1234
Copy link
Contributor Author

I have made a release 1.0.0

@RohanVashisht1234
Copy link
Contributor Author

@packagecontrol-bot

@RohanVashisht1234
Copy link
Contributor Author

Yes, it worked.

@RohanVashisht1234
Copy link
Contributor Author

RohanVashisht1234 commented Apr 19, 2024

Braver, once you are done with the checks, from my side, I think all the changes have been made and this pr is ready to be merged. Thanks for guiding me.

@RohanVashisht1234
Copy link
Contributor Author

And if you find any other issues, please let me know

Copy link
Collaborator

@packagecontrol-bot packagecontrol-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated testing result: WARNING

Repo link: Carbon Programming Language
Results help

Packages added:
  - Carbon Programming Language

Processing package "Carbon Programming Language"
  - WARNING: '.sublime-syntax' support has been added in build 3092 and there is no '.tmLanguage' fallback file
    - File: carbon.sublime-syntax

@braver
Copy link
Collaborator

braver commented Apr 20, 2024

Good job, LGTM! 👍🏻

@braver braver merged commit 07d43fe into wbond:master Apr 20, 2024
2 checks passed
@RohanVashisht1234
Copy link
Contributor Author

Thanks alot 😊

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

Successfully merging this pull request may close these issues.

3 participants