Process to request support for additional languages

2013-12-12
2014-04-30
  • Nicolas Corai
    Nicolas Corai
    2013-12-12

    Hi,

    I mucked with "Define my language" but when I am on a different machine and I forget to take my definition with me, I'm back at square one. Also it seems a bit limited in the parsing rules that can be defined.

    So I'd like to propose support for (in decreasing order of priority as far as I'm concerned):
    - Ceylon
    - SCSS
    - SASS
    - Scala
    - Groovy
    - LESS
    What is the process to request support for new languages?

     
  • Loreia2
    Loreia2
    2013-12-13

    Hi Nicolas.

    is short you can request it here:
    https://sourceforge.net/p/scintilla/bugs/
    https://lists.sourceforge.net/lists/listinfo/scintilla-interest

    In practice Niel will just tell you to implement it yourself and contribute the code.

    For easier sharing, submit UDL definitions here:http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files

    Also, please define which feature of those languages can't be defined by UDL.

    BR;
    Loreia

     
  • cchris
    cchris
    2013-12-15

    SCSS and LESS are dialects of CSS and support can be anebled by setting the appropriate property on (both) Scintilla when using the CSS lexer.

    CChris

     
  • Dragon Chuang
    Dragon Chuang
    2014-04-18

    When I open LESS file (.less), notepad++ always detected it as "Normal Text",
    I have to manually change language to "CSS".

    I tried to add "less" into css's ext attribute in langs.model.xml, but not working.

    How to ask notepad++ use "CSS" lexer open .less file just like it using "C++" open "h, cpp..." ?

    Thanks.

     
  • Dragon Chuang
    Dragon Chuang
    2014-04-18

    I change langeuage to "CSS", but notepad++ display incorrect style...
    I browsed scintilla\lexers\LexCSS.cxx, found a property "lexer.css.less.language" it needed to set for LESS file.

    But I am a layman of C++...

     
  • Dragon Chuang
    Dragon Chuang
    2014-04-22

    Hi Loreia,

    Thank you. I did it :D

    # Just in case, we'll clear all the existing callbacks for FILEOPENED
    notepad.clearCallbacks([NOTIFICATION.FILEOPENED])
    
    # Define the function to call just after the file is opened
    def lessFileHelper(args):
        bufferID = args['bufferID']
        filename = notepad.getBufferFilename(bufferID)
    
        if filename[-5:] == '.less':
            notepad.activateBufferID(bufferID)
            notepad.setCurrentLang(LANGTYPE.CSS)
            editor.setProperty('lexer.css.less.language', '1')
    
    # ... and register the callback 
    notepad.callback(lessFileHelper, [NOTIFICATION.FILEOPENED])
    

    .
    But, NOTIFICATION is not fired when Notepad++ startup.
    I have to close and reopen LESS file if I restart notepad++.

     
  • Loreia2
    Loreia2
    2014-04-22

    Hi Dragon Chuang,

    make sure Python plugin initialization is not LAZY (default), but ATSTARTUP.
    You can find this option in plugin's Configuration panel.

    Does that help?

    BR,
    Loreia

     
  • Dragon Chuang
    Dragon Chuang
    2014-04-22

    Hi Loreia,

    The initialization is ATSTARTUP already, but not working.
    Is notepad++ loading plugins after the last session (files) was opened ?

    Best Regards

     
  • Loreia2
    Loreia2
    2014-04-22

    Hi Dragon Chuang,

    Is notepad++ loading plugins after the last session (files) was opened ?

    I don't know, if I would have to make a guess, I'd say not.
    Can you try to trigger callback on SCINTILLANOTIFICATION.FOCUSIN message too?
    This is just a wild guess based on enumeration's name, but it could work.

    Regards,
    Loreia

     
  • Dragon Chuang
    Dragon Chuang
    2014-04-22

    I added this code to startup.py, but nothing happened when notepad++ startup.

    (Notepad++ version 6.5.5, Python Script version 1.0.4.0)

    notepad.clearCallbacks([SCINTILLANOTIFICATION.FOCUSIN])
    
    def callbackTest(args):
        console.write("Callback")
    
    notepad.callback(callbackTest, [SCINTILLANOTIFICATION.FOCUSIN])
    
     
  • Dragon Chuang
    Dragon Chuang
    2014-04-23

    I confirmed a situation.
    NOTIFICATION is not fired when Notepad++ startup (restore last session).
    But it is working when I load session from File > Load Session menu.

     
  • Loreia2
    Loreia2
    2014-04-23

    Hi Dragon Chuang,

    I guess next step would be to verify in source code which notification message is sent to application when session is restored. I don't have enough free time to do it right now, but I might be able to do it over the weekend.

    BR,
    Loreia

     
  • Dragon Chuang
    Dragon Chuang
    2014-04-23

    Hi Loreia,

    This issue is not critical. (low priority) :)

    Notepad++ doesn't store or restore properties (lexer.css.less.language, etc) in session, so I have to set property again when Notepad++ restart or load session.

    Thank you for your support.

    Best Regards,
    Dragon

     
  • Dragon Chuang
    Dragon Chuang
    2014-04-23

    Update code for Python Script 1.0.4.0:

    # Just in case, we'll clear all the existing callbacks for FILEOPENED
    notepad.clearCallbacks([NOTIFICATION.FILEOPENED])
    
    # Define the function to call just after the file is opened
    def lessFileHelper(args):
    
        bufferID = args['bufferID']
        filename = notepad.getBufferFilename(bufferID)
    
        if filename[-5:] == '.less':
            notepad.activateBufferID(bufferID)
            notepad.setLangType(LANGTYPE.CSS)
            editor.setProperty('lexer.css.less.language', '1')
    
    # ... and register the callback 
    notepad.callback(lessFileHelper, [NOTIFICATION.FILEOPENED])
    
     
  • f p
    f p
    2014-04-30

    Hi,

    I had a specific request for an aplication in freebasic and freedos and I discovered there is no language plugin for basic. Any ideas?

     
  • Loreia2
    Loreia2
    2014-04-30

    Hi f p,

    did you try UDL module?
    http://udl20.weebly.com/

    BR,
    Loreia