Page 1 of 1

PN editor support

PostPosted: Thu Jun 18, 2009 5:38 pm
by arisawa
PN(Programmer's Notepad2: http://www.pnotepad.org/) support for Cobra.
This work in progress OK?

Because I cannot operate a trac, I describe below it.

setting: save following code to 'cobra.scheme' and into schemes directory.
tested: portable version for Windows.
issue: cannot automatic lexer select.
improvement hint: http://pnotepad.org/docs/howto/add_support_for_your_language

--- cobra.scheme ---
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Scheme>
   <keyword-classes>
      <keyword-class name="cobra.key">
         use var inherits implements interface override shared enum namespace set get pro objc vari new event except expect extend
         partial extern nonvirtual public private abstract struct assert test old mixin must adds const import class cue off internal
         as is has while from sig def on yield elif body ensure implies invariant require virtual protected where be callable of inlined
         all and any base branch break catch continue do each else end every expect false finally for if ignore in inout
         listen nil not on or out pass passthrough post print raise ref return stop success this throw to trace true try using
         bool int char float decimal dynamic number same uint
      </keyword-class>
      <keyword-class name="cobra.init">
         init
      </keyword-class>
   </keyword-classes>
   <language name="cobra" title="Cobra" folding="true" foldcomments="true" foldcompact="false">
      <lexer name="python" />
      <comments line="#" />
      <property name="tab.timmy.whinge.level" value="1"/>
      <use-keywords>
         <keyword key="0" name="Keywords" class="cobra.key"/>
         <keyword key="1" name="Keywords" class="cobra.init"/>
      </use-keywords>
      <use-styles>
         <style name="Default" key="32" />
         <style name="Whitespace" key="0" class="whitespace" />
         <style name="Comment" key="1" class="comment"/>
         <style name="Number" key="2" class="number"/>
         <style name="String" key="3" class="string"/>
         <style name="Single-Quoted String" key="4" class="string"/>
         <style name="Keyword" key="5" class="keyword"/>
         <style name="Triple Quotes" key="6" fore="7f0000"/>
         <style name="Triple Double Quotes" key="7" fore="7f0000"/>
         <style name="Class name" key="8" class="class"/>
         <style name="Function or method name" key="9" class="function"/>
         <style name="Operators" key="10" bold="true"/>
         <style name="Identifiers" key="11"/>
         <style name="Comment block" key="12" fore="7f7f7f" />
         <style name="Unclosed string" key="13" class="string" back="e0c0e0" eolfilled="true" />
         <style name="Highlighted Identifiers" key="14" fore="407090" />
         <style name="Decorators" key="15" fore="805080" />
      </use-styles>
   </language>
</Scheme>

Re: PN editor support

PostPosted: Thu Jun 18, 2009 6:02 pm
by Charles
Work in progress is fine. Editor contributions are always welcome.

Your Trac username and password is the same as your forums username and password.

Re: PN editor support

PostPosted: Fri Jun 19, 2009 2:25 pm
by arisawa
There was a hesitation about the problem of my linguistic competence.
Please point it out if there is a strange part.
http://cobra-language.com/trac/cobra/wiki/PN

thank :)

Re: PN editor support

PostPosted: Fri Jun 19, 2009 7:30 pm
by gauthier
Thanks! I'm testing the tool (I'm usually editing with Scite)

is there a way to autocomplete keywords from the current file?

is there a way to setup ctags?

Re: PN editor support

PostPosted: Fri Jun 19, 2009 11:47 pm
by arisawa
Hi, gauthier.

As for keyword autocomplete, select
Tools > Options > AutoComplete > AutoComplete After: ~ characters

As for setup ctags, it is still unknown...

Re: PN editor support

PostPosted: Sat Jun 20, 2009 2:55 pm
by arisawa
Tags does not function for Cobra now.
This is seem to the problem of extension distinction.
Though Tags does not function when the extension is 'cobra'.
It is possible to use it temporarily by making the extension 'py','cs' etc.

Re: PN editor support

PostPosted: Sat Jun 20, 2009 5:30 pm
by arisawa
I saw the method of settlement.
http://pnotepad.org/docs/howto/tag_custom_languages
but I am not good at English :roll:
Please succeed someone and investigate.

Re: PN editor support

PostPosted: Sat Jun 20, 2009 7:53 pm
by arisawa
Example:
Edit to /taggers/ctags/additionalSupportedSchemes.ini
Code: Select all
Each section represents corresponds to a scheme name with tagging defined
externally in additionalLanguages.conf.
 :
 :  ~omission~
 :
[cobra]
n = 14
c = 3
m = 15
e = 5


Edit to /taggers/ctags/additionalLanguages.conf
Code: Select all
--langdef=cobra
--langmap=cobra:.cobra
--regex-cobra=/^namespace ([A-za-z0-9]*\>)/\1/n,Namespace/i
--regex-cobra=/class ([A-za-z0-9]*\>)/\1/c,Class/i
--regex-cobra=/enum ([A-za-z0-9]*\>)/\1/e,Enum/i
--regex-cobra=/cue ([a-z0-9]*\>)/\1/m,Method/i
--regex-cobra=/def ([a-z0-9]*\>)/\1/m,Method/i