Skip to content

Swift: highlight underscore-prefixed class names - #4102

Open
official-burak wants to merge 1 commit into
PrismJS:v2from
official-burak:fix/swift-underscore-class-names
Open

official-burak wants to merge 1 commit into
PrismJS:v2from
official-burak:fix/swift-underscore-class-names

Conversation

@official-burak

@official-burak official-burak commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • Swift types such as _Foo and __Bar were not highlighted as class names because the pattern required an immediate uppercase letter.
  • Allow an optional underscore prefix so those names match Swift's convention for client-visible private API.

Fixes #4100

Test plan

  • npx mocha tests/run.js --language=swift
  • Pattern tests for the updated class-name regex
  • CI on this PR

Private types such as _Foo were missed because the class-name pattern required an immediate uppercase letter.
@netlify

netlify Bot commented Aug 29, 2026

Copy link
Copy Markdown

Deploy Preview for dev-prismjs-com ready!

Name Link
🔨 Latest commit 5ed88d6
🔍 Latest deploy log https://app.netlify.com/projects/dev-prismjs-com/deploys/6a931d41ca12fe000856e198
😎 Deploy Preview https://deploy-preview-4102--dev-prismjs-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

No JS Changes

Generated by 🚫 dangerJS against 5ed88d6

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

Successfully merging this pull request may close these issues.

Swift class regex doesn't support private names (ex. '_Foo')

1 participant