Repository navigation
[FEAT] - Copy the program information #261
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
How about such a thing as Webstorm does which allows you to copy program information.
In this case I copy only the version of the program in use.
It would also be useful to know:
- The version of the OS
- The version of Xcode
What do you think?
Registrazione.schermo.2022-03-26.alle.09.05.54.mov
I have a problem with animation, if anyone would like to give me some advice if you want this feature.
Code:
HStack {
Text("Version \(appVersion) (\(appBuild))")
.foregroundColor(.secondary)
.font(.system(size: 13))
if isHovering {
Image(systemName: "doc.on.doc")
.resizable()
.frame(width: 15, height: 15)
.transition(AnyTransition.opacity.animation(.easeInOut(duration: 0.25)))
.onHover { inside in
if inside {
NSCursor.pointingHand.push()
} else {
NSCursor.pop()
}
}
.onTapGesture {
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
guard let url = NSWorkspace.shared.urlForApplication(withBundleIdentifier: "com.apple.dt.Xcode"),
let bundle = Bundle(url: url) else {
print("Xcode is not installed")
exit(1)
}
guard let infoDict = bundle.infoDictionary,
let version = infoDict["CFBundleShortVersionString"] as? String else {
print("No version found in Info.plist")
exit(1)
}
let pasteboard = NSPasteboard.general
pasteboard.clearContents()
pasteboard.setString(
"CodeEdit: \(appVersion) (\(appBuild))\n" +
"MacOS: \(osVersion.majorVersion).\(osVersion.minorVersion).\(osVersion.patchVersion)\n" +
"XCode: \(version)"
, forType: .string)
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
- StatusShow more project fields🏁 Complete
Activity
lukepistrol commentedon Mar 26, 2022
I would do it like this:
or using a context menu
Angelk90 commentedon Mar 26, 2022
@lukepistrol : I would like it more if the copy icon appears, but you decide how you prefer.
This is the code at the moment:
Registrazione.schermo.2022-03-26.alle.13.20.59.mov
fix(comments): Add Support for Commenting Multiple Lines (CodeEditApp…