Bunn / Xgist

Xcode extension to send code to GitHub's Gist
MIT License
77 stars 5 forks source link

Improve language detection #2

Open insidegui opened 7 years ago

insidegui commented 7 years ago

Currently, the extension uses the content UTI to set the extension of the file on Gist, it would be better to detect the language based on the actual contents of the snippet.

Bunn commented 7 years ago

My only concern with this is adding too much complexity on something the content UTI already provides.

One use case for this would be if the user selects a C++ code inside a .mm file, but then again, a C++ code set as .mm is also correct even if only the C++ code is selected.

The situation where I can see this being useful is if an user has, a string with a XML for example, and only the XML content is selected for the gist. Then, the current approach would not set as XML, but as .swift or something else.

I'll leave it open for now but I consider this to be a low priority issue.