Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Drupal. #150

Open
manoj-apare opened this issue Dec 21, 2015 · 1 comment
Open

Support for Drupal. #150

manoj-apare opened this issue Dec 21, 2015 · 1 comment

Comments

@manoj-apare
Copy link

Please add support for Drupal documentation standard like:

/**
 * [function description].
 *
 * @param [type] $id
 *   [description].
 * @param [type] $type
 *   [description].
 *
 * @return [type]
 *   [description].
 */

Sorry if it is wrong/bad, for now I modified DocBlockrAtom.prototype.create_snippet to achieve this. Modification is as below:

for(i=0; len = out.length, i < len; i++) {
  out_temp = out[i].replace(/\s+/g, " ").replace(/\s\$\{(\d+):\[description\]\}/g, '\n *   ${$1:[description]}.');
  snippet+= '\n ' + this.prefix + (out_temp ? (this.indentSpaces + out_temp) : '');
}

I am waiting for your reply/help on how to achieve this in proper manner.

@manoj-apare
Copy link
Author

Small update on the issue. I added one additional settings variable 'drupal_mode' like 'simple_mode' and conditionally changed the snippet like:

for(i=0; len = out.length, i < len; i++) {
  if(this.editor_settings.drupal_mode == true) {
    out[i] = out[i].replace(/\s+/g, " ").replace(/\s\$\{(\d+):\[description\]\}/g, '\n *   ${$1:[description]}.');
  }
  snippet+= '\n ' + this.prefix + (out[i] ? (this.indentSpaces + out[i]) : '');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants