ENH: infer language driving the kernel and update syntax
Disclaimer: this might be unfeasible because it might involve dynamic changes to tmLanguage files.
Now that there are more and more languages implementing ipython kernels (Julia, Go, Haskell, ...), it might make sense to expand the syntax highlighting (and by extension all the snipets/completions, ect. provided by sublime) for code cells. This would involve changing this line of SublimeIPythonNotebook.tmLanguage to be updated dynamically based on the metadata given at the top of the .ipynb JSON file.
For example, when using IJulia (ipython with julia backend), the first few lines of the .ipynb are
{
"metadata": {
"language": "Julia",
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
whereas with a normal python based notebook we have
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
Actually changing the line would be easy, but the question we need to ask is whether or not we would be worried about corrupting the tmLanguage source or introducing a security issue by allowing this file to be dynamically updated.
I guess another option would be to have different tmLanguage files for each type of backend (they would be copy/paste of one another with minor changes) and we would somehow instruct sublime on which one to use based on the backend.
Instructing sublime to use different tmLanguage files is easy: look for this line view.set_syntax_file("Packages/IPython Notebook/SublimeIPythonNotebook.tmLanguage") and change it to the syntax you want. Generating syntax files on the fly might be doable, but having them pre-made will probably not be that bad - it's not like there is new language added to IPython Notebook every day.