We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a main.swfit swift file like below:
main.swfit
import Foundation func functest() { print(123) }
I can use sourcekitten structure to get function names:
sourcekitten structure --file main.swift | jq '."key.substructure"[] | select(."key.kind" == "source.lang.swift.decl.function.free") | ."key.name"'
and match the functions:
sourcekitten structure --file main.swift | jq '."key.substructure"[] | select(."key.kind" == "source.lang.swift.decl.function.free") '
the result:
but how to get source code ?
I want to implement a function given the function name( functest ) then return the source code
functest
func functest() { print(123) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a
main.swfit
swift file like below:I can use sourcekitten structure to get function names:
and match the functions:
the result:
but how to get source code ?
I want to implement a function given the function name(
functest
) then return the source codeThe text was updated successfully, but these errors were encountered: