How to add new programming language support to Xcode ?

Hello,


Is there any way to add a new programming language support to Xcode ?


Actually, I'm more interested in adding a new syntax coloring.


But I didn't find anything on the web...


Hope you can help me 🙂

Answered by valentindusollier in 626401022
The xclangspec was the key, there isn't any documentation but by reading similar project for other language and the built-in file, I manage to do what I wanted.

So I create a repo to add Latex support for Xcode : LaTeX-for-Xcode.

Xcode supports source code for the programming languages C, C++, Objective-C, Objective-C++, Java, AppleScript, Python, Ruby, ResEdit (Rez), and Swift, with a variety of programming models, including but not limited to Cocoa, Carbon, and Java.

Third parties have added support for GNU Pascal,[5] Free Pascal,[6] Ada,[7] C#,[8] Perl,[9] and D.[10]

Source : h ttps://en.wikipedia.org/wiki/Xcode


Which one would you want to add ?


I've never ventured in those areas. But there are XCode extensions.

https://developer.apple.com/documentation/xcodekit/creating_a_source_editor_extension


And a few implementation tutorials

h ttps://www.vadimbulavin.com/xcode-source-editor-extension-tutorial/

h ttps://code.tutsplus.com/tutorials/how-to-create-an-xcode-source-editor-extension--cms-26772


But that may not be enough to create a full fledge editor.

Thanks for your answer 😉


Yes, I already use Xcode for my C, Swift, Java, Python and HTML / JS projects. In fact, I'm trying to make Xcode my main IDE.


Now, I would like to create my LaTeX documents with it. I could edit the Scheme to make it use `pdflatex` with the right arguments.

The only things missing would be syntax coloring and auto-completion.


I read docs and tutorials about Xcode Source Editor Extension you suggested me. But it doesn't seem to allow me to edit the syntax coloring.


I saw a project already exists to use LaTeX on Xcode but it's latest supported version is Xcode 5... The project use "xclangspec" and "xcsynspec" files which seem to tell Xcode the syntax and how to color it. But it seems that those files cannot be use with Xcode 11, I didn't find quite anything about it on web.

Accepted Answer
The xclangspec was the key, there isn't any documentation but by reading similar project for other language and the built-in file, I manage to do what I wanted.

So I create a repo to add Latex support for Xcode : LaTeX-for-Xcode.

How to add new programming language support to Xcode ?
 
 
Q