-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
enh(swift) highlight function and macro call usage #3959
base: main
Are you sure you want to change the base?
enh(swift) highlight function and macro call usage #3959
Conversation
Build Size ReportChanges to minified artifacts in 4 files changedTotal change +241 B View Changes
|
Build Size ReportChanges to minified artifacts in 3 files changedTotal change +231 B View Changes
|
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +241 B View Changes
|
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +207 B View Changes
|
We can't use negative lookahead until v12 though because it's a breaking change. And I don't have a timetable on that yet. |
@joshgoebel This is an adapted version of Javascript's implementation which is already using negative lookahead ( see here). My understanding was that only lookbehind is not allowed currently. |
58079a4
to
a0db36f
Compare
Build Size ReportChanges to minified artifacts in 5 files changedTotal change +207 B View Changes
|
@joshgoebel Is there a way forward for this PR? If the concern is a language-specific breaking change, the Swift language itself is already using negative lookahead as well, here. |
Sorry for delay. I think debug_it("hello world") # debug_it is `title.function` (seems to be global function call)
person.eat("sandwich") # `eat` is a property of person, that also appears to be a method/function Thoughts? |
Improve fidelity by highlighting function calls in addition to definitions. This is already done by javascript, for example.
Changes
negativeLookahead
helper tolib/regex
title.function
(e.g.myFunction()
,obj.myFunction()
).title.function
(e.g.#myMacro()
).TRAILING_PAREN_REGEX
obj.if()
). Highlight keyword method calls also.#
and@
respectively. If they don't start with these, they're no longer considered reserved.`myFunc`()
). This feature exists so that reserved words can be used as identifiers.obj.myVariable
) remain unhighlighted for now.Next Steps (for a future PR)
exampleCall { print("action") }
Checklist
CHANGES.md