Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:50:39+00:00 2026-06-14T02:50:39+00:00

When working on .js files in xcode, the method browser works and list traditional

  • 0

When working on .js files in xcode, the method browser works and list traditional functions. Such as:

function OBj (e){
        for (var i in e) {
            enyo.log("element ", i, " is ", e[i])
        }
    };

or…

var OBj = function(e) {
        for (var i in e) {
            enyo.log("element ", i, " is ", e[i])
        }
    };

But what about other patterns?…. such as:

Obj.method({

    init: function() {},
    data: function() {},

})

This is where xcode falls short for me. So in this question/answer post, I present a shell script which I wrote in order to provide the type of method navigation which I needed for the javascript pattern type that I used. Utilizing the marker ??? feature in xcode, the shell script simply loops through all .js files in a specified folder, and by way of pattern matching it seeks out all methods that adheres to the pattern:

init: function() {},

It injects a commented matching marker so you would now have:

Obj.method({

//???:init
    init: function() {},
//???:data
    data: function() {},

})

Which happily shows up on xcode’s method drop down list:

enter image description here


I have provided the script as the answer part to my question. Simply copy and paste into a file. Put that file inside the folder where your JS files are located. From the terminal, cd to that folder and run the shell script: ./scriptname

Golden!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:50:42+00:00Added an answer on June 14, 2026 at 2:50 am
    #!/bin/bash
    # ***WARNING: BACK UP YOUR FILES BEFORE RUNING THIS SCRIPT ON THEM
    
    # JS function pattern
    v1=': function'
    
    # Change these to point to the paths of your own JS files
    temp_file='/Users/.../Documents/.../www/.../'
    jsfolder='/Users/.../Documents/.../www/.../'
    
    
    # Do not change anything below unless you know what you doing,
    # as it will likely break the script.   
    v2="\/\/\?\?\?\:"
    temploc='temp_file'
    for i in "${jsfolder}"*.js
    do
    sed -e  's/'"${v2}"'.*//' -e 's/ *\([^: ]*\)'"${v1}"'.*/'"${v2}"'\1\
    &/' $i > $temp_file$temploc
    mv $temp_file$temploc $i
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on files in drupal. i use local wamp server with drupal6.
i'm new to the realm to working with Files in .NET I'm creating a
I am working with XML files that are generated by a digital video camera.
We've been working on some files at the same time. Occasionally, when we svn
I have been working with resource files for a while now and I was
Does anyone have any useful advice/links to information about working with mp3 files in
I`m working on a script to create csv files for an analysis. When running
Im working on a Java Application that edits Pdf files. Furthermore a shell script
I'm working with some local json files but I'm having some problems with the
We're working with some very large config files which contain lots of Unity and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.