idleberg / vscode-applescript

Language syntax and snippets for AppleScript
https://marketplace.visualstudio.com/items?itemName=idleberg.applescript
MIT License
70 stars 8 forks source link

Add more applescript extensions support #4

Closed JimiC closed 7 years ago

JimiC commented 7 years ago

According to wikipedia .scpt, .scptd, .AppleScript are also valid file extensions.

We are going to support applescript via language id in vscode-icons.

idleberg commented 7 years ago

Both, scptand scptd, are binary AppleScripts that can't be opened by Visual Studio Code at this moment. Once Microsoft exposes an event to manipulate a file prior to opening (e.g. a load-equivalent to onWillSaveTextDocument), I will add support these formats.

Edit: I wonder if onWillSaveTextDocument has been removed recently, since it's no longer listed in the API documentation

JimiC commented 7 years ago

Fair enough. What about camelCase AppleScript?

idleberg commented 7 years ago

Are you sure it's necessary to support both, .applescript and .AppleScript? Syntax is already highlighted properly for both cases. I don't mind adding it, but it seems language detection is already case-insensitive.

JimiC commented 7 years ago

It may has to do with vscode detection. Haven't checked it to be honest. I'll verify it and come back to you.

JimiC commented 7 years ago

Come to think of it again my request isn't so much about highlighting as to associate those extensions with an icon. In case they won't be added we will have to associate them manually.

From what I know Mac and Linux are case-sensitive when it comes to file naming so I don't think vscode diverge from that. It will take me some time to return home to my Mac machine to verify my case.

idleberg commented 7 years ago

Not sure why my version of vscode-nsis doesn't show any icon for AppleScript, but I tested it using NSIS:

screen shot 2017-01-31 at 10 26 54

JimiC commented 7 years ago

@idleberg The thing is that @robertohuertasm has mistakenly associated the applescript icon with the .app extension. I'm going to fix that in the upcoming version by supporting it via language id. If your extension doesn't include .scpt and .scptd we will have to explicitly add them in the declaration.

Regarding the case-sensitivity I tested on Linux and it's as you say, so we are good on that front.

Edit: Indeed it's a trivial issue for you, but I would like to know so we to act accordingly.

idleberg commented 7 years ago

Just to mention it: a special case is an .app created with AppleScript. The AppleScript Editor can load these again for editing since they are basically just an Application folder bundling the script (<appname>/Contents/Resources/Scripts/main.scpt) and several resources. Since it won't be applicable to make a difference between a standard application and an AppleScript application, .app should generally use the icon designed for applications. I guess, that a prior version of vscode-icons used the Apple icon for both, AppleScript and macOS applications.

As for scpt and scptd, you could go on and include both extensions as binary files. Once Visual Studio Code can process files prior to loading them in the editor (e.g. for decoding binary AppleScript bundles), we can change that icon to AppleScript.

JimiC commented 7 years ago
  1. .app will be moved to binary icon.
  2. OK. We'll associate .scpt and .scptd to the binary icon.

Thanks a lot for your input.