Your comments

If you open it once with the wrong encoding, it will be saved with this encoding if you make changes to it.


If you can't change it to ISO-Latin 1, it means that the file now contains characters that can't be expressed in the selected encoding.


You could try to tap-and-hold the file in the Files section and select "Open with Encoding" and choose ISO-Latin 1. But, I doubt that this helps once it is saved with the wrong encoding, sorry.

I received your file.


The problem is this line:


"scope": "source.as - comment - string",


If you look at the file "Syntaxes/ActionScript 3.tmLanguage" in the ActionScript 3 bundle, you can see that the scopeName for ActionScript 3 files is defined as "source.actionscript.3", not "source.as":


<key>scopeName</key>
<string>source.actionscript.3</string>


So, you need to change the line in the as.json file in this way:


"scope": "source.actionscript.3 - comment - string",


Also make sure that you select the "ActionScript 3" syntax definition in the File Properties in Textastic after you open the file.


After this change, Textastic successfully displayed a list of completions.

I understand your frustration. But, can you please send me the file to support@textasticapp.com ? Unfortunately, the forum software messed with the formatting.


I will have a look at it and send you a working example.

I'm not sure if I understand you correctly, but maybe this is the info you are looking for:


If you want to create a new code completion definition, you can put the .json file in the local "#Textastic/CodeCompletion" folder. Textastic will pick up the changes at application startup time, so you have to manually quit the app. 


The combination of "scope" and "pattern" defines where code completion are shown.

You can generate a uuid on the Mac command line with this command:

uuidgen

Each completion file needs its own uuid to identify the file uniquely in the system and to make it load correctly.


The "completionSets" array defines a list of completion strings and gives them a name.


The "contexts" array at bottom of a completion file defines where the completion strings should be shown. This is the linkage point of the language file and the completion file:


The "scope" and the "pattern" work together: "scope" is a scope selector like "source.objc - comment - string" (see http://manual.macromates.com/en/scope_selectors). It must match the scope at the cursor.

 

"pattern" is a regular expression. It must also match backwards at the cursor position. 


The "completionCaptureIndex" defines which capture of the "pattern" will be used as the string to complete. 


The "completionSetNames" array defines which completion sets should be consulted for code completion in this context.


I hope this helps.

Textastic only uses the syntax definitions in the "Languages" folder of a TextMate bundle and some settings from the "Preferences" folder.


For code completion, it uses its own format: https://github.com/blach/Textastic-Customization - you can find the built-in definitions in the CodeCompletion directory.

iCloud backup already backs up the files in Textastic.


But, I'm currently working on a Mac app and iCloud support in the iOS apps.

Which connection settings do you use when you get this error?