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

Add support for code formatting in Obj-C header comments #631

Closed
brycebostwick opened this issue Nov 22, 2019 · 2 comments
Closed

Add support for code formatting in Obj-C header comments #631

brycebostwick opened this issue Nov 22, 2019 · 2 comments

Comments

@brycebostwick
Copy link
Contributor

This would only require a change in commentBody() in Clang+SourceKitten.swift (as best as I can tell!).

Two different scenarios that would be good to support:

Individual @c Word Highlighting

And:

Highlighting an entire codeblock:

@code
print("Hello world!")
@endcode

The first should be implementable via regex / wrapping the targeted word in backticks.

The second can be rougly implemented by just replacing @code and @endcode with triple-backticks, though this would result in different results from Xcode in some scenarios (most of which should be considered error scenarios already / even cause warnings in Xcode, essentially in situations where the keywords are in a different order or count than expected).

@brycebostwick
Copy link
Contributor Author

I have a basic implementation of the above strategy locally & will open a PR in a bit, but definitely happy to talk about the change here, including any other ways of tackling this!

@jpsim
Copy link
Owner

jpsim commented Jan 6, 2020

Added in #632.

@jpsim jpsim closed this as completed Jan 6, 2020
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

2 participants