Menu

Drupal Autocomplete

2008-10-08
2013-05-22
  • armyofda12monkeys

    i was working on getting Drupal in Notepad++.,
    got something decently so far...

    Here are the drupal.xml and userDefinedLanguage.xml, and a readme where to install.
    http://www.arianhojat.com/files/drupal

    just need some tips to get it the way i want. as it is not there yet :)

    i mixed in php from php.xml already there with drupal since devs are going to want both.

    1.
    I think the ordering of my xml is bad, pretend i have Array_func, array_merge, _array_drupal_merge. what order should they be in? i read something about ignorecase attribute, but i dont think i want to ignore the case.

    2.
    also i cant get block comments to work. i use /* and */ to no avail. i am thinking maybe cause they are delimters?

    3.
    anyway so the meta info about params are used? like the return type of a drupal or php function. didnt seem to work. just the function's name pops up.

    4.
    antoher problem is a line like for this line of code...
    $string = 'string';
    $ is an operator and is blue.
    string is not an operator so its default color black
    = ' is blue since operators.
    string is black since default.
    '; is blue.

    i was wondering if can get it so 'string' is grey (though still keep string in $string as black) like notepad++ php's styling. wasnt sure if i need to reset my operators or styling in userDefinedLanguage.xml file

    Thanks,
    Arian

     
    • janusman

      janusman - 2009-07-29

      Links don't work anymore... would love to have these =)

       
    • armyofda12monkeys

      Got those issues pretty much fixed.
      Just some things to make sure, single line comments should always be followed by a space "// This is a comment"
      A line might show up funky if its like "$x = 'Delete the node\'s author?';" as it is hard to distinguish where string ends.

      Here is a screenshot:
      http://arianhojat.com/files/drupal/notepad_plus_plus/screenshot.png

       
    • armyofda12monkeys

      P.S. the files are moved to the notepad_plus_plus folder
      http://arianhojat.com/files/drupal/notepad_plus_plus/

       
  • armyofda12monkeys

    I'm recreating the files. so Ill update these sometime in next day/week.

     
  • cchris

    cchris - 2009-12-28

    There is something wrong in the install instructions:

    userDefineLang.xml should go in the installation folder, and drupal.xml in the APIs subfolder. The destinaions have been swapped.

    Also, some users (like me) don't use %APPDATA%, so this might deserve being mentioned in the install notes.

    CChris

     
  • armyofda12monkeys

    Ahhh yes,
    readme.txt is updated.

    Also for capital letter keywords, you can Cntrl+Enter, but not type letters and get autocompletion, did i mistakenly put Capital letters at the top of the XML file, when they should be somewhere else?

    and I shall update that readme also with %APPDATA% info, but i forget where in the Preferences that setting is so users can check.
    Looked at each tab, couldn't find it.

     
  • cchris

    cchris - 2009-12-28

    The install folder is a choice you make when using the installer, or when you choose a folder to unpack a zipped archive to.

    Also, the inoformation about the language should be inside the information related to the language; currently it is outside it.

    CChris

     
  • armyofda12monkeys

    >The install folder is a choice you make when using the installer, or when you choose a folder to unpack a zipped archive to.

    Gotcha, so the UDL file may need to be uploaded to C:/Program Files/Notepad++ if user choose to store his settings there. Will update the instructions.

    >Also, the information about the language should be inside the information related to the language; currently it is outside it.

    Didn't quite understand this statement, what do ya mean?

    Side Question: The autocomplete has trouble recognizing the first few capitalized or underscored keywords like MENU_CALLBACK or __CLASS__, I sorted normal ASCII I believe so not sure why those don't work… (Can just press CONTROL+ENTER for now and pick from top of the list).

    I shall start learning the plugin system so I can mess with getting that textarea so can put more functions in, but for now this is pretty useable.

     
  • cchris

    cchris - 2009-12-29

    > >    Also, the information about the language should be inside the information related to the language; currently it is outside it.

    > Didn't quite understand this statement, what do ya mean?

    Here is the start of your file: 

        <?xml version="1.0"?>
        <NotepadPlus>
            <Environment ignoreCase="no" startFunc="(" stopFunc=")" paramSeparator="," terminal=";"/>
           <AutoComplete language="drupal">
              <KeyWord name="MENU_ACCESS_DENIED"/>
        …

    4th line starts the definitions for one language - there may be several sets in one file. As a result, the >Environment> tag should be inside such a set, since it provides info about one language. In a nutshell, the Environment line should be inside an Autocomplete, but is outside it.

    This explains why the default of case insensitive is being used, resulting in the file being incorrectly sorted from the parser's standpoint. Swap lines 3 & 4.

    CChris

     
  • armyofda12monkeys

    ahhhhh thanks CChris!
    Works perfectly now. Thanks for all your help!,
    Arian

     
  • armyofda12monkeys

    Also got rid of {} as operators per your instructions, so code-folding now works.

     
  • Thomas Ohms

    Thomas Ohms - 2011-12-20

    Thanks for your work. That was exactly what I was looking for!

     
  • armyofda12monkeys

    Note: latest code is here since i dont host this on my site anymore:
    includes Drupal 6 and 7 syntax highlighter/autocompleter for Notepad++...

    http://drupal.org/node/326803#comment-7438408