Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-389

TiStudio code completion for Alloy style files (TSS)

    Details

      Description

      Alloy style files, which are in a custom TSS format, need TiStudio code completion. Since TSS is a brand new format, TiStudio is going to need an actual specification for the TSS format. For this I have started constructing a true grammar in pegjs for the TSS format. The work on that is being logged in ALOY-272. This grammar will need to be completed, tested to ensure that replaces the current logic effectively, and then inserted as a replacement to the custom logic code in Alloy now. No small feat, so resolving ALOY-272 will be a big hurdle to jump before getting style code completion.

      Once a grammar has been established, there area few ways in which TiStudio code completion would be useful in style files, all of which will occur as a developer is typing the property key names inside the style definition:

      1. If the style in question refers to a Titanium API, code completion based on the Titanium API type. For example:

        "Window": {
            backgroundColor: '#fff'
        }
        

        as a developer is typing "backgroundColor' above, TiStudio should be helping code complete based on the fact that the style is for a Ti.UI.Window.

      2. If the style refers to an ID, code completion based on the type of the IDed component as identified in the corresponding view XML.

        <!-- index.xml -->
        <Label id="myLabel"/>
        

        // index.tss
        "#myLabel": {
            text: 'some text'
        }
        

        TiStudio should see #myLabel, understand that it is an ID style, find the UI component that it corresponds to in index.xml (in this a Ti.UI.Label), and then do code completion based on the determined type of Titanium API.

      3. If the style refers to a class, code completion will work just as it does in the case of IDs, but the code completion will give a listing that is the intersection of all the properties that apply to any UI components given this class.

      One final note is the handling of the global style app.tss. Since the app.tss has no associated view, it might make sense to only do code completion in the case of #1 where a Titanium API is given. I would imagine it would be a little to resource intensive to inspect all files in a project to look for IDs and classes in the cases of #2 and #3.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tlukasavage Tony Lukasavage
                Reporter:
                tlukasavage Tony Lukasavage
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration