Code Completion

Alexander Blach (Developer) 14 years ago updated 3 years ago 54 1 duplicate
"I generally code in C, C++, Objective-C and on occasion PHP, HTML, Javascript and CSS. Code completion for the above would be great!
After using the app for a bit, I noticed that while it's really incredible to have a code editor on the go, too much typing on the ipad isn't really that great."


Textastic 4.0 will have code completion for HTML, CSS and for PHP functions.

Textastic 4.0.2 adds code completion for JavaScript.
Duplicates 1
Code completion for C# (see MonoDevelop), PHP, HTML, JS, and CSS would be excellent.
One of my favorite features in Coda for Mac. This would kick ass if properly implemented on the iPad.
For Ruby :)
Possible so that the user can add completion.
or maybe TextMate Snippets ;)
Auto complete closing tags in XML, html would be a great timesaver.
I agree intellisense (I presume this is what you are referring too) would be awesome, but you can get quite a bit done using the TextExpander app which Textastic supports. Just a suggestion for a solution, if only temporary.
Also Python, it would be great,
Regarding C/C++/Obj-C you might want to look into clang/llvm http://clang.llvm.org/get_started.html - while this is a full fledged compiler toolkit, one might check the ios appstore publishing guideline if it is possible to extract the part necessary for code completion disabling the compiler functionality - and if not possible one could host clang on a server and let textastic ssh into it working as a kind of editor cache using clang as a back-end.
Here is code completion for vim using clang/LLVM - might serve as a starting point - https://github.com/Rip-Rip/clang_complete
Using an SSH session to a compiler could also close the gap of the missing compiler/debugger in Textastic without reinventing the wheel on your side and also provide a good deal of language independent toolkit - you only would need to send control commands to the compiler/debugger, feed back and parse the output in Textastic and you could even highlight problems in the code. This is probably easier than the code completion itself and possibly about as useful.

For code completion - there possibly looking into what scripts/tools are there on the server side (e.g. scripts for vim) is probably easier than integrating the code in textastic itself. One could try to tap into the scripts, extract the completion tree and sync it with textastic over SSH.
You could leave language dependent code completely on the server-side and allow users to contribute server side connectors for Textastic - otherwise as a single developer it will be difficult to support more than a few languages even with the approach of reusing code from other tools.
Along the lines of code completion I guess is the ability to quickly navigate to other files based on following the function to its source. Assuming of course that the code completion you are talking about goes beyond just the standard language comands/functions. I am assuming this is more of a docblock code hinting/completion feature. If not, then maybe another category needs to be created... I am assuming a feature like that in netbeans or eclipse.
Would it be possible instead of trying to implement every language to write a base framework and allow your users to create and customize their syntax definitions? These definition files could then be hosted in a private or public repository like GitHub where we can share and improve them and updating the definitions would only require a pull from the repo.
I plan to do something like that for Textastic 3.0.
Maybe you can use zen-coding!!!!!!
TextExpander works great with Textastic. No need for code completion now.

Please add Adobe ColdFusion code completion to this. I have not purchased yet but that would be a fast sell for me if you did.


I bought and still miss textastic ColdFusion
code completionto!

I hope i´t coming soon :-)

Word completion rather than code completion would be a more generic solution. Vim and Textmate both provide similar features. The Vim version is superior as it uses a dictionary of words derived from all open buffers, not just the current file. Given the difficulty of typing on the iPad, this would save a huge number of keystrokes without needing so much setup with Textexpander. Not sure how you would decide which files to base the completion dictionary on however - perhaps all in the current folder ? Even if it was just the currently open file that would be a win.
Ruby and JS and Pig code completion.
I code in MXML, Actionscript 3, Java, Python, HTML, XML, Javascript and CSS. I love textastic for its breadth of use amongst all these. However, I have found that without code completion, its use can be limiting as syntax amongst a variety of languages is often only slightly different and I end up spending as much time debugging the code when putting it to use later on as it saved me in using the app on the go. Whereas a good code hinting and code completion setup, along with the syntax highlighting I feel could avoid most issues that tangle up. I really hope it can be a part of the next release.
Textastic 4.0 will have code completion for HTML, CSS and for PHP functions.
i could not agree more, I CAN NOT wait until code hints get integratd into this app, it will be hands down the best I-pad text editor and possibly one of the best text editors period, HOPE IT COMES SOON!!
The new version 4.0 with code completion for HTML and CSS should be available any day now.
Cool... tested v4 and must say nice thing. Maybe you can extend the feature with customize able dictionaries in future versions to support other languages as well ( maybe for js functions ). 

But again thank you for textastic 4.0 =)
In theory it's already customizable, but I haven't documented it yet.
Aw nice ^^ 

At all I have to take back some of my words from the past. Textastic is now the best editor on iPad and it's nice to see a well developed program on iOS. :D
Textastic 4.0 will have code completion for HTML, CSS and for PHP functions.

Textastic 4.0.2 adds code completion for JavaScript.


Are you planning any code completion for Python?



Hi All,

Just wanted to share that I've put together a code completion file for WordPress for use with Textastic. It's available on GitHub here:


I wouldn't expect this to be bundled with Textastic since WordPress is more like a framework, not a language. Still, for those who use WordPress regularly, it can certainly help to have auto-complete!

Thanks for sharing this, Dave!

Thanks for this Dave!!!. I'm giving it a try right away

I feel I should be able to do this, but there is a rising link. I'd like, as a first step, juts to be able to inert strings anywhere in a markdown file (scope text.html.markdown, apparently). Then I seem to need at least one completionSet and one Context. So, working with a minimal set, my JSON file in the CodeCompletion folder is:

"description": "Textastic Code Completion for pml simples",
"uuid": "2F13083A-0CA1-4211-A392-EBCD4AF5FAF8",

"completionSets": [
"name": "pml-metadata",
"defaultAppend": "XX",
"strings": [
{"string": "WebTitle: "},
{"string": "FileName: "}

"contexts": [
"description": "pml language",
"scope": "text.html.markdown",
"pattern": "~([a-zA-Z0-9]*)",
"completionCaptureIndex": 1,
"completionSetNames": [

Bit no action? I understand this is not documented yet, but I am having a hard time looking at the few examples and tying to guess my way out of trouble.

At the moment I have the 'trigger' as '~', but I quite fancy 'pml': I cannot even tell if that is possible.

Thanks in anticipation

I just tried your file and it actually works for me:

Did you put the file in the correct folder? It should be in "Local Files/#Textastic/CodeCompletion" as seen in the screenshot.

Thanks Alexander:

I was trying it out on the Mac, where it is here:

So: /Users/Ian/Library/Containers/com.textasticapp.textastic-mac/Data/Library/Application Support/Textastic/CodeCompletion/pmlSimples.JSON

I'm afraid I got fed up with restarting the app to test my iterative attempts, so posted here. Glad at least the JSON is fine.

I've just copied it over to an iPad, and popped it in the correct folder, but still no joy. There is something weird going on here I tried renaming it to pm.JSON, and a copy and paste from this web page, in case either introduced gremlins.

Maybe just me. However for reference the Mac version is Version 3.2 (30) & the IoS version is whatever the latest update to version 6 is. html code completion works fine on either. Mystery. I'll come back to it later, I think. For now, I am out of ideas...At least the format looks tractable and you've given me some confidence that I might manage to bend it to my will.

Please rename the file from "pm.JSON" to "pm.json" (lower case file extension) and it should work.

Thank you. It did—both platforms.

Now to get more adventurous—but tomorrow—there is quite a bit of the pml to shift from and implementation in the ACE online editor

This is going quite well...

In case anyone else is reading this, it turns out to be possible to have strings like :

" UnitWord{${1:unitname}} $0",

Which highlights "unit name" for you to overtype, and then on tab jumps to the $0 location.

One more question if I may: is it possible to delete the 'trigger'. I know it is 'code completion', but I suppose what I am really doing here is creating a snippet system. If not I can do a regex replace after writing, but I wondered if there was anything like $COMPLETION that might do the trick? Thanks again.

Is it possible to delete the 'trigger'. I know it is 'code completion', but?

Try to use replace instead of append. You can find an example at https://github.com/blach/Textastic-Customization/blob/da5b6db31f84d836519fef2ef60e513e724a0685/CodeCompletion/js.json#L14

{ "string": "forin", "replace": "for (${1:variable} in ${2:object}) {\n\t$0\n}" },

Hi! Great app you‘ve coded! 👍🏼

Is there a possibility to enable code completion for known variable names? I started to use this app in iOS for my home automation with Fhem in Perl and I couldn‘t find out how to complete my already known variables. Is there a possibility to do this?

Best regards 



Currently not, but it is something I want to add in a future update.


Ok, thank you! This would be a really helpful feature! Maybe it could be solved like in Notepad ++ for Windows. There you get every word you typed before in this file as a suggestion. What do you think about this?

how to add code completion for python? I have tried copying this json file from this 


But it failed even though I’ve changed the uuid. 

Copying the tmbundle folder from this link

https://github.com/textmate/python.tmbundle Also did not work.

Thank you for this excellent App! But as a fresher to programming I don't know how to use the code completion for C and C++ language.. So do you have a official setting or customized completion for it? Thanks

Sorry I expressed falsely. I mean the auto-indent for unique language like the bracket in C


I would love code completion for SWIFT ... I fear from your poll that very few of the developers using Textastic are swift developers though.

I guess it teaches you to be a better (less lazy) coder! 

The code completion is great but I am trying to make a file for tailwindCSS and I am not sure how to get it to recognise multiple classes. The first class is no problem but after that it's just not picking anything up. The HTML.json is close to what I need to be fair but I am not quite sure what the sources are referring to etc. Is there any more documentation for this feature?

Currently I am using Textastic as an editor for my latex documents. I’ve came across the Youtube Channel imaginary mass, who published a video on how to use it. He wrote up a code completion file latex.json which I put in #Textastic\CodeCompletion, but it doesn’t work. Any ideas what the problem could be?


the file works for me. I get code completions when I enter a backslash "\".

Did you reload customizations as explained at https://www.textasticapp.com/v10/manual/customization/custom_syntax_themes_templates.html#reload-customizations?