-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Provide more specific file type descriptions on macOS #117713
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
Conversation
037df13 to
c59ed56
Compare
853a28c to
c9d10a8
Compare
|
Fixed the build errors, but still haven't actually been able to test it |
Yeah let's create one.
You're good here, no worries. 👌
You'll be able to build an OSS version of VS Code with |
|
@NSExceptional I'll set the PR to draft until you've tested and we're ready for a review. |
|
@joaomoreno No dice, it builds without errors then fails to run :/ Is it possible I messed something up while snooping around in the OSS build folder? I tried |
|
Try |
|
That did the trick. It worked! Here's the generated Info.plist |
c9d10a8 to
a9839f4
Compare
|
Noticed there were no associated file extensions in my screenshot 🤪 Fixed; I was indexing the object improperly in function darwinBundleDocumentTypes(types: { [name: string]: string | string[] }, … {
return Object.keys(types).map((name: string, idx: number): DarwinDocumentType => {
const extensions = types[idx]; // <-- using idx by mistake
...→ function darwinBundleDocumentTypes(types: { [name: string]: string | string[] }, … {
return Object.keys(types).map((name: string): DarwinDocumentType => {
const extensions = types[name]; // <-- use name instead
... |
a9839f4 to
45ca118
Compare
|
Compilation is now failing here because of |
|
@joaomoreno Do you know what's going on? I need some guidance |
|
Just merge |
With this change, to define a document type, you need only pass the name (or relative path) of the darwin icon. So instead of passing 'resources/darwin/css.icns' you would just pass 'css'
Allow the caller to provide a specific file type description. The new function will not require source changes to existing calls, but will change how the file type description is generated. An unmodified call to darwinBundleDocumentType will use the given icon name as the file type description. All extensions passed to this function continue to use the same icon as before, and all extensions will have the same file type description as before.
Split darwinBundleDocumentType into two separate functions. The first function is unchanged. The second function allows you to specify specific names for different groups of extensions while all sharing the same icon. For example, this would allow you to differentiate between a C header and a C source file while using the same icon for both. Inherently, the second function will generate multiple file type declarations, so it returns an array instead of a single object. As a result we must use the splat operator on it when passing the result to an array literal.
Make use of the changes in the previous commit
45ca118 to
772f41f
Compare
|
No wonder, I was rebasing on my local |
|
@joaomoreno All checks passed! |
|
@joaomoreno does this have any blockers? |
|
@joaomoreno will this be put into the May milestone? |
|
Thanks! 🍻 |



Motivation and Summary of Changes
Right now, VS Code defines the file type description for every file association it creates as "VS Code document", which is not very useful. The file type description is what appears in the Info pane for a file in Finder:
This PR aims to 1) make it possible to specify specific names at all, and 2) to provide some default names for most of the existing supported file types.
My commit messages and code documentation have more detailed information on the approach I took to this.
Oh, also, I could not for the life of me figure out how to get these changes to build. I ran
yarn compileinsidebuild/and it built the*.jsfiles, but could not get the results published in the final product. If someone can tell me how to do that, I will test it on my machine to ensure it works as expected.PR Checklist
There is no issue associated with this PR, because I just started on a PR first instead of making an issue.
Do I need to create an issue anyway?
I have read through the coding guidelines and I think the only guideline I may be breaking is this one:
However, I'm not sure where to put the two new types I declared. I need some direction here if my PR cannot be merged because of this.