Skip to content

Vim syntax highlighting improvements #2782

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

Conversation

compnerd
Copy link
Member

What's in this pull request?

Resolved bug number: (SR-)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

compnerd added 6 commits May 30, 2016 21:50
A typename is a name for a type being defined.  A type may contain optionality
as well.  This ensures that we do not accidentally highlight an invalid name
such as `InvalidName?` as a type name.

Fix the fact that I had previously created a special group for the array.  An
array is a type, so it should be part of the same group.
We currently only do init<T>.  Only permit generalization of init, not deinit,
subscript.
Perform more clever highlighting of generic clauses.  The archetype identifier
is now identified as an identifier, the archtetype type as a type, and the
constraints (where) as special syntax.
Check for a type declaration following an attribute.  This corrects the
highlighting of function types such as:

  @NoEscape (Wrapped) throws -> T
Swift permits the use of reserved keywords as identifiers.  Reflect that in the
syntax highlighting.

syn region swiftTypeParameters start="<" end=">" contained
syn keyword swiftNew skipwhite nextgroup=swiftTypeName
\ new
Copy link
Contributor

Choose a reason for hiding this comment

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

I think new is historic. Please feel free to drop it.

@gribozavr gribozavr merged commit 56bb5dd into swiftlang:master May 31, 2016
@gribozavr
Copy link
Contributor

Bug report: try opening stdlib/private/StdlibCollectionUnittest/CheckRangeReplaceableCollectionType.swift. The array literals (around line 300) are highlighted as types.

@compnerd
Copy link
Member Author

Hmm, I will look into the issue you pointed out. The immediate idea that I have works for that but breaks the parameter list in function declarations :-(. lll also drop new.

@compnerd compnerd deleted the vim-syntax-highlighting-improvements branch July 3, 2016 17:25
MaxDesiatov pushed a commit that referenced this pull request Apr 19, 2021
[pull] swiftwasm from main
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.

2 participants