Skip to content

Swift language grammar for syntax highlighting

License

Notifications You must be signed in to change notification settings

jtbandes/swift-tmlanguage

Repository files navigation

Swift language grammar

Swift.tmLanguage is a TextMate language grammar for the Swift programming language. It defines regex-based parsing rules so that code renderers can highlight Swift code using a semantic color scheme.

image

This grammar is used for syntax highlighting by:

(It was also used by GitHub Linguist until 2024.)

The language grammar is available in three formats:

Development

  • Run yarn install to install dependencies.

  • After making changes to the YAML grammar, run yarn build to regenerate the .tmLanguage.json and .tmLanguage files.

  • To test the grammar in VS Code, press F5 to load the current version of the .tmLanguage in a new window. After each yarn build, reload the window to load the updated .tmLanguage. (If you have the vscode-swift extension installed, you'll need to disable it so it doesn't override the scopes provided by the .tmLanguage grammar.)

Maintenance status

The Swift grammar was developed for years at textmate/swift.tmbundle, which is no longer actively maintained. Development of the grammar continues here.

This grammar is maintained by @jtbandes as a passion project. If you'd like to support past and future development, please consider making a donation. 💖

License

This project is licensed under the terms of the MIT license.

About

Swift language grammar for syntax highlighting

Resources

License

Stars

Watchers

Forks