Changeset 186

Show
Ignore:
Timestamp:
12/14/06 22:28:45 (2 years ago)
Author:
Alan Knowles
Message:

Simplify interfaces - getLanguageHander always returns a Language Object - no need to test, constructor uses codeview, so that does not need to be passed around

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/leds/BrowserView.d

    r177 r186  
    321321        toExpand.length = 0; 
    322322         
    323         fileView.getLanguageHandler().loadBrowserData(fileView,this); 
     323        fileView.getLanguageHandler().loadBrowserData(this); 
    324324        treeView.setModel(browserTreeStore); 
    325325        treeView.expandToPath(new TreePath("1")); 
  • trunk/src/leds/CodeView.d

    r185 r186  
    821821        } 
    822822        if (this.getLanguageHandler()) { 
    823             this.getLanguageHandler().checkSyntax(this); 
     823            this.getLanguageHandler().checkSyntax(); 
    824824            setBrowserView(text); 
    825825            //missingReturn(); 
     
    841841    { 
    842842        // writefln("getLanguage Handler %s", fileName); 
    843         if (this.languageHandler) { 
     843        if (!this.languageHandler) { 
    844844            //writefln("returned existing"); 
    845             return this.languageHandler; 
    846         } 
    847          
    848         if ( fileName.length>=8 && fileName[0..7].equalsIgnoreCase("makefile") ) 
    849         { 
    850             //writefln("languageHandler == Makefile"); 
    851             this.languageHandler = new LanguageMakefile(workspace); 
    852             return this.languageHandler; 
     845            this.languageHandler = Language.factory(this); 
    853846             
    854847        } 
    855          
    856         switch ( Path.getExt(fileName).toUpper().toString() ) { 
    857              
    858             case "HTML", "HTM", "PHP", "XUL", "JS", "CSS": 
    859                 //writefln("languageHandler == PHP"); 
    860                 this.languageHandler = new LanguagePHP(workspace); 
    861                 return this.languageHandler; 
    862                  
    863                  
    864             case "D", "C", "CPP", "H": // fixme.. - sort out handlers for all of these. 
    865                 this.languageHandler = new LanguageD(workspace); 
    866                 //writefln("languageHandler == D"); 
    867                 return this.languageHandler; 
    868              
    869             default:  
    870                 return null; 
    871               
    872         } 
    873           
     848        return this.languageHandler; 
    874849         
    875850    } 
     
    877852    void missingReturn() 
    878853    { 
    879         // FIXME - move this to LanguageD 
    880         auto lang = getLanguageHandler(); 
    881         if (!lang || !cast(LanguageD)lang ) 
    882         { 
    883             return; 
    884         } 
    885         String missing = lang.getMissingReturn(this); 
     854        String missing = getLanguageHandler().getMissingReturn(); 
    886855        if (missing) { 
    887856            System.writefln("Missing return on: ", missing); 
    888857        } 
    889           
    890          
    891          
     858           
    892859    } 
    893860     
     
    11321099                    ++functionLine; 
    11331100                     
    1134                     if (this.getLanguageHandler()) { 
    1135                         this.getLanguageHandler().addAutoDocComments(this,functionLine, commStr ); 
    1136                          
    1137                          
    1138                     } 
     1101                    getLanguageHandler().addAutoDocComments(functionLine, commStr ); 
     1102                     
    11391103                     
    11401104                     
     
    12301194                 
    12311195            case "lexer.D":          
    1232                 this.languageHandler  = new LanguageD(workspace); 
     1196                this.languageHandler  = new LanguageD(this); 
    12331197                this.languageHandler.setLex(this.codeEdit); 
    12341198                break; 
    12351199                 
    12361200            case "lexer.makefile":   
    1237                 this.languageHandler  = new LanguageMakefile(workspace); 
     1201                this.languageHandler  = new LanguageMakefile(this); 
    12381202                this.languageHandler.setLex(this.codeEdit); 
    12391203                break; 
    12401204             
    12411205            case "lexer.html":       
    1242                 this.languageHandler  = new LanguagePHP(workspace); 
     1206                this.languageHandler  = new LanguagePHP(this); 
    12431207                this.languageHandler.setLex(this.codeEdit); 
    12441208                break; 
     
    13981362        } 
    13991363        Language lang = this.getLanguageHandler(); 
    1400         if (!lang) { 
    1401             return false; 
    1402         } 
    1403         String[] fileandNum = lang.getElementLocation(this, elementName, lineNumber); 
     1364         
     1365        String[] fileandNum = lang.getElementLocation(elementName, lineNumber); 
    14041366        if (!fileandNum.length) { 
    14051367            return false; 
     
    15961558            return false; 
    15971559        } 
    1598         if (!this.getLanguageHandler()) { 
    1599             return false; 
    1600         } 
     1560         
    16011561        auto str = getLeftRightId(); 
    16021562        if (!str.length) { 
     
    16041564        } 
    16051565        // let's show help.. 
    1606         this.getLanguageHandler().showHelp(this,str); 
     1566        this.getLanguageHandler().showHelp(str); 
    16071567         
    16081568         
     
    16211581            return false; 
    16221582        } 
    1623         Language lang = this.getLanguageHandler(); 
    1624         if (!lang) { 
    1625             return false; 
    1626         } 
    1627         String[] fileandNum = lang.getElementLocation(this, codeEdit.getSelected(), codeEdit.getCurrLine()); 
     1583         
     1584        String[] fileandNum = getLanguageHandler().getElementLocation(codeEdit.getSelected(), codeEdit.getCurrLine()); 
    16281585        if (!fileandNum.length) { 
    16291586            return false; 
     
    17671724    void extractInterface(MenuItem item) 
    17681725    { 
    1769          
    1770         if (!getLanguageHandler()) { 
    1771             return; 
    1772         } 
    1773         String iText = getLanguageHandler().extractInterface(this); 
     1726          
     1727        String iText = getLanguageHandler().extractInterface(); 
    17741728        if (!iText.length) { 
    17751729            return; 
     
    19181872        if ( ( language == Language.LangType.JAVA ) && getLanguageHandler()) { 
    19191873             
    1920             modulePath ~= getLanguageHandler().getModulePath(this); 
     1874            modulePath ~= getLanguageHandler().getModulePath(); 
    19211875              
    19221876        } 
     
    20532007        if (stringPrint.length() > 0 ) 
    20542008        { 
    2055             String containerFunc = new String(); 
    2056             if (getLanguageHandler()) { 
    2057                 containerFunc = getLanguageHandler().getContainerFunc(this,codeEdit.getCurrLine()); 
    2058             } 
     2009              
     2010            String containerFunc = getLanguageHandler().getContainerFunc(codeEdit.getCurrLine()); 
    20592011             
    2060              
    2061              
    2062               
    20632012            codeEdit.setCurrentPos(pos-1); 
    20642013            int offsetPos = 0; 
     
    22662215            return; 
    22672216        } 
    2268         if (!this.getLanguageHandler()) { 
    2269             return; 
    2270         } 
     2217         
    22712218        String start = new String(); 
    2272         String[] list = this.getLanguageHandler().getLookupList(this,start); 
     2219        String[] list = this.getLanguageHandler().getLookupList(start); 
    22732220        if ((list.length > 0) && start.length) { // is testing for empty start a good idea? 
    22742221            //writefln("Show auto completion?"); 
     
    25852532    { 
    25862533        //writefln("Auto Select done : %s", s.toString()); 
    2587         if (!this.getLanguageHandler()) { 
    2588             return false; 
    2589         } 
    2590         this.getLanguageHandler().showHelp(this,s); 
     2534         
     2535        this.getLanguageHandler().showHelp(s); 
    25912536        return false; 
    25922537    } 
     
    27222667                    && Leds.leds.getPropValue("autoComplete",true) ) 
    27232668                    { 
    2724                         if ( this.getLanguageHandler() && this.getLanguageHandler().canAutoComplete(this)) { 
     2669                        if ( this.getLanguageHandler().canAutoComplete()) { 
    27252670                            fireAutoCompletion(); 
    27262671                        } 
     
    29222867            return; 
    29232868        } 
    2924         if (!this.getLanguageHandler()) { 
    2925             return; 
    2926         } 
    2927         this.getLanguageHandler().addFolds(this); 
     2869         
     2870        this.getLanguageHandler().addFolds(); 
    29282871        this.collapseAll(); 
    29292872        this.hasFolds = true;  
  • trunk/src/leds/Language.d

    r180 r186  
    1919        D, 
    2020        JAVA, 
    21         PHP 
     21        PHP, 
     22        MAKEFILE, 
    2223    } 
    2324    // imports have to go here to stop forward referencing. 
     
    3940 
    4041     
    41     Workspace workspace; 
     42     
     43    static Language factory(CodeView codeview) 
     44    { 
     45        LangType lt = getLanguageFromFileName(codeview.getFileName()); 
     46        switch (lt) { 
     47            case Language.LangType.D: 
     48                return new LanguageD(codeview); 
     49            case Language.LangType.PHP: 
     50                return new LanguagePHP(codeview); 
     51            case Language.LangType.JAVA: 
     52                return new LanguageJava(codeview); 
     53            case Language.LangType.MAKEFILE: 
     54                return new LanguageMakefile(codeview); 
     55            default: 
     56                return new Language(codeview); 
     57             
     58        } 
     59    } 
    4260     
    4361    this() 
     
    4664    } 
    4765     
    48     this(Workspace ws) 
    49     { 
    50         this.workspace = ws; 
    51     } 
     66    CodeView codeview; 
     67     
     68    this(CodeView codeview) 
     69    { 
     70        this.codeview = codeview; 
     71    } 
     72     
    5273     
    5374    /** 
     
    7293    } 
    7394     
    74     void loadBrowserData(FileView fileView, BrowserView bv) 
     95    void loadBrowserData(BrowserView bv) 
    7596    { 
    7697         
     
    82103     * @param codeview  
    83104     */ 
    84     abstract void addFolds(CodeView codeview); 
    85      
    86     bool canAutoComplete(CodeView codeview) 
     105    void addFolds()  
     106    { 
     107         
     108    } 
     109     
     110    bool canAutoComplete() 
    87111    { 
    88112        return false; 
     
    95119     */ 
    96120     
    97     abstract String[] getLookupList(CodeView codeview, inout String start); 
     121    String[] getLookupList(inout String start) 
     122    { 
     123        String[] str; 
     124        return str; 
     125    } 
    98126    /** 
    99127     * On saving the file, this is called to see if there are any syntax errors 
     
    103131     * @return  
    104132     */ 
    105     abstract bit checkSyntax(CodeView codeview); 
     133    bit checkSyntax() 
     134    { 
     135        return true; 
     136    } 
    106137    /** 
    107138     * setup all the options for scintilla to render language correctly. 
    108139     * @param scintilla  
    109140     */ 
    110     abstract void setLex(Scintilla scintilla); 
     141    void setLex(Scintilla scintilla) 
     142    { 
     143         
     144    } 
    111145    /** 
    112146     * show help in help bar giving autocompletion or just a string. 
    113147     * @param s string to show help about. 
    114148     */ 
    115     abstract void showHelp(CodeView codeview, String s); 
     149    void showHelp(String s) 
     150    { 
     151         
     152    } 
    116153     
    117154     
     
    127164    } 
    128165      
    129     String[] getElementLocation(CodeView codeview, String s, int lineNumber) 
     166    String[] getElementLocation(String s, int lineNumber) 
    130167    { 
    131168        String[] ret; 
     
    135172     * Check for return missing. 
    136173     */ 
    137     String getMissingReturn(CodeView codeview)  
     174    String getMissingReturn()  
    138175    { 
    139176        return null; 
     
    143180    { 
    144181        LangType language = LangType.NONE; 
     182        if ( fileName.length>=8 && fileName[0..7].equalsIgnoreCase("makefile") ) 
     183        { 
     184                language = Language.LangType.MAKEFILE; 
     185        } 
     186         
    145187        if ( fileName !is null && fileName.length>0 ) 
    146188        { 
    147189            switch(Path.getExt(fileName).toString()) 
    148190            { 
    149                 case "d"
     191                case "d", "c", "cpp", "h"
    150192                    language = LangType.D; 
    151193                    break; 
     
    155197                    break; 
    156198                     
    157                 case "html": 
    158                 case "php": 
     199                case "html", "htm", "php", "xul", "js", "css": 
    159200                    language = LangType.PHP; 
    160201                    break; 
     
    163204                    language = LangType.NONE; 
    164205                    break; 
     206                      
     207                     
    165208            } 
    166209        } 
     
    210253     */ 
    211254     
    212     void addAutoDocComments(CodeView codeview, int functionLine,char[] commStr) 
     255    void addAutoDocComments(int functionLine,char[] commStr) 
    213256    { 
    214257    } 
     
    216259     * get Module page - used to get Java path. 
    217260     */ 
    218     String getModulePath(CodeView codeview
    219     { 
    220         return new String(); 
    221     } 
    222     String getContainerFunc(CodeView codeview, int line) 
     261    String getModulePath(
     262    { 
     263        return new String(); 
     264    } 
     265    String getContainerFunc(int line) 
    223266    { 
    224267        return new String(); 
    225268    }    
    226     String extractInterface(CodeView codeview
     269    String extractInterface(
    227270    { 
    228271        return new String(); 
  • trunk/src/leds/LanguageD.d

    r180 r186  
    4343    private import std.stdio; 
    4444     
    45     this(Workspace ws
    46     { 
    47         super(ws); 
     45    this(CodeView codeview
     46    { 
     47        super(codeview); 
    4848    } 
    4949     
     
    9797     
    9898     
    99     void loadBrowserData(FileView fileView, BrowserView bv) 
    100     { 
    101         if (!(cast(CodeView)fileView)) { 
    102             //writefln("loadBrowserData - not Codeview?"); 
    103             return; 
    104         } 
    105         Element sourceModule = getCachedModule(cast(CodeView)fileView); 
     99    void loadBrowserData(BrowserView bv) 
     100    { 
     101         
     102        Element sourceModule = getCachedModule(); 
    106103         
    107104        if (!sourceModule ) { 
     
    312309     
    313310     
    314     void addFolds(CodeView codeview
     311    void addFolds(
    315312    { 
    316313         
    317         Element sourceModule = getCachedModule(codeview); 
    318           
    319         this.addFoldsElement(codeview, sourceModule, 0); 
     314        Element sourceModule = getCachedModule(); 
     315          
     316        this.addFoldsElement(sourceModule, 0); 
    320317         
    321318    } 
    322319     
    323     void addFoldsElement(CodeView codeview, Element element, int foldOffset) 
     320    void addFoldsElement(Element element, int foldOffset) 
    324321    { 
    325322         /* 
     
    366363   
    367364         foreach(Element elementChild ; element.elements.sort) { 
    368             addFoldsElement(codeview, elementChild,newFoldOffset + 1); 
     365            addFoldsElement(elementChild,newFoldOffset + 1); 
    369366         } 
    370367          
     
    380377     * This still needs more work, as typing a space causes a reparse.. 
    381378     */ 
    382     bool canAutoComplete(CodeView codeview
     379    bool canAutoComplete(
    383380    { 
    384381         
     
    399396    } 
    400397     
    401     String[] getLookupList(CodeView codeView, inout String start) 
     398    String[] getLookupList(inout String start) 
    402399    { 
    403400        //return  (new CodeLookup(codeview)).getLookupList(codeview, start); 
     
    407404         
    408405        // recalculate the code browser 
    409         Module sourceModule = getCachedModule(codeView); 
     406        Module sourceModule = getCachedModule(); 
    410407         
    411408        // gets the inner most container for this line 
    412         Element container = sourceModule.getContainerForLine(codeView.getLineNumber()); 
     409        Element container = sourceModule.getContainerForLine(codeview.getLineNumber()); 
    413410        if ( container is null ) 
    414411        { 
     
    417414         
    418415        // determines the tokens to the left of the caret 
    419         start = codeView.getLeftId(); 
     416        start = codeview.getLeftId(); 
    420417             
    421418            debug(lookup) printf("CodeLookup.getLookupList start = %.*s\n", start.toString()); 
    422419         
    423         Project project = codeView.getProject(); 
     420        Project project = codeview.getProject(); 
    424421        // let's start by doing a static lookup. 
    425422        if (!project) { 
     
    561558     * @return true if the sintax is correct 
    562559     */ 
    563     bit checkSyntax(CodeView codeview
     560    bit checkSyntax(
    564561    { 
    565562        //debug(flow ) System.writefln("CodeView.checkSintax 1"); 
     
    653650        //debug(flow ) System.writefln("CodeView.checkSintax 8"); 
    654651        codeview.getWorkspace().getSystemConsole.print("Compile Result:\n" ~ spawn.getOutputString() ~ "\n"); 
    655         checkSyntax(codeview, spawn.getOutputString(), spawn.getErrorString()); 
     652        checkSyntax( spawn.getOutputString(), spawn.getErrorString()); 
    656653        //workspace.getStatusbar().addBackgroundProcess(); 
    657654        //debug(flow ) System.writefln("CodeView.checkSintax 9"); 
     
    661658    } 
    662659 
    663     bit checkSyntax(CodeView codeview, char[] grabOutput, char[] grabError) 
     660    bit checkSyntax(char[] grabOutput, char[] grabError) 
    664661    { 
    665662        foreach ( String line ; (new String(grabOutput)).splitLines() ) 
     
    838835     */ 
    839836     
    840     void showHelp(CodeView codeview, String s) 
     837    void showHelp(String s) 
    841838    { 
    842839        String[] strs = s.split("("); 
     
    844841         
    845842        char elementType = ' '; 
    846         Element e = getElementByName(codeview, s, codeview.getLineNumber(), elementType); 
     843        Element e = getElementByName(s, codeview.getLineNumber(), elementType); 
    847844         
    848845          
     
    905902    static d_time cachedModuleReadTime; 
    906903     
    907     Module getCachedModule(CodeView codeview
     904    Module getCachedModule(
    908905    { 
    909906        //writefln("trying to get cached view"); 
     
    945942     
    946943     
    947     Element getElementByName(CodeView codeview, String s, int lineNumber, inout char elementType) 
     944    Element getElementByName(String s, int lineNumber, inout char elementType) 
    948945    { 
    949946         
     
    958955            return null; 
    959956        } 
    960         Module sourceModule = this.getCachedModule(codeview); 
     957        Module sourceModule = this.getCachedModule(); 
    961958          
    962959        // gets the inner most container for this line 
     
    11041101     */ 
    11051102     
    1106     String[] getElementLocation(CodeView codeview, String s, int lineNumber) 
     1103    String[] getElementLocation(String s, int lineNumber) 
    11071104    { 
    11081105         
     
    11141111        String[] ret; 
    11151112        char elementType = ' '; 
    1116         Element e = getElementByName(codeview, s, lineNumber, elementType); 
     1113        Element e = getElementByName(s, lineNumber, elementType); 
    11171114          
    11181115        switch (elementType) { 
     
    11561153     */ 
    11571154     
    1158     String getMissingReturn(CodeView codeview
    1159     { 
    1160          
    1161         auto thisModule = this.getCachedModule(codeview); 
     1155    String getMissingReturn(
     1156    { 
     1157         
     1158        auto thisModule = this.getCachedModule(); 
    11621159         
    11631160        if ( !thisModule ) 
     
    11651162            return new String(); 
    11661163        } 
    1167         return getMissingReturn(codeview, thisModule); 
    1168          
    1169          
    1170          
    1171     } 
    1172      
    1173     String getMissingReturn(CodeView codeview,Element element) 
     1164        return getMissingReturn(thisModule); 
     1165         
     1166         
     1167         
     1168    } 
     1169     
     1170    String getMissingReturn(Element element) 
    11741171    { 
    11751172        String miss = new String(); 
     
    11901187            foreach ( Element child ; element.getElements() ) 
    11911188            { 
    1192                 miss ~= getMissingReturn(codeview,child); 
     1189                miss ~= getMissingReturn(child); 
    11931190            } 
    11941191        } 
     
    12071204     
    12081205    bit findContainer(    
    1209                         CodeView codeview, 
    12101206                        out Block container,  
    12111207                        out Function funct, 
     
    12201216        //debug(autoComments) System.writefln("CodeView.findContainer 1"); 
    12211217        bit found = false; 
    1222         Module mod = this.getCachedModule(codeview); 
     1218        Module mod = this.getCachedModule(); 
    12231219        container = cast(Block)mod.getContainerForLine(lineNumber); 
    12241220        //debug(autoComments) System.writefln("CodeView.findContainer 3"); 
     
    12511247     */ 
    12521248     
    1253     void addAutoDocComments(CodeView codeview, int functionLine,char[] commStr) 
     1249    void addAutoDocComments(int functionLine,char[] commStr) 
    12541250    { 
    12551251         
     
    12641260        debug(autoComments) System.writefln("CodeView.doAutoDocComments NOT emptyDocComments 1"); 
    12651261 
    1266         if ( findContainer(codeview, container, funct, functionLine) ) 
     1262        if ( findContainer(container, funct, functionLine) ) 
    12671263        { 
    12681264            debug(autoComments) System.writefln("CodeView.doAutoDocComments NOT emptyDocComments 2"); 
     
    13421338     * get module path support - technically only needed for Java.. 
    13431339     */ 
    1344     String getModulePath(CodeView codeview)   
     1340    String getModulePath()   
    13451341    { 
    13461342         
     
    13611357      
    13621358     
    1363     String getContainerFunc(CodeView codeview, int line) 
     1359    String getContainerFunc(int line) 
    13641360    { 
    13651361        String ret=new String(); 
     
    13681364        Block container; 
    13691365        Function funct; 
    1370         if ( !findContainer(codeview, container, funct, line ) ) 
     1366        if ( !findContainer(container, funct, line ) ) 
    13711367        { 
    13721368            return ret; 
     
    13761372    } 
    13771373     
    1378     String  extractInterface(CodeView codeview
    1379     { 
    1380          
    1381           
    1382         Module sourceModule = this.getCachedModule(codeview); 
     1374    String  extractInterface(
     1375    { 
     1376         
     1377          
     1378        Module sourceModule = this.getCachedModule(); 
    13831379             
    13841380        String iText = new String(); 
  • trunk/src/leds/LanguageJava.d

    r153 r186  
    1212    private import dool.String; 
    1313     
    14     this(Workspace ws
     14    this(CodeView codeview
    1515    { 
    16         super(ws); 
    17     } 
     16        super(codeview); 
     17    }  
    1818     
    1919    static void setProps(Properties props) 
     
    6363 
    6464    } 
    65     void addFolds(CodeView codeview) 
    66     { 
    67          
    68     } 
    6965     
    70     String[] getLookupList(CodeView codeview, inout String start) 
    71     { 
    72         String[] ret; 
    73         return ret; 
    74     } 
     66      
    7567     
    76     bit checkSyntax(CodeView codeview) 
    77     { 
    78         return true; 
    79     } 
     68  
    8069     
    8170    void setLex(Scintilla scintilla) 
     
    10998        scintilla.setUseTabs(Leds.leds.getPropValue("useTabs.java", true)); 
    11099    } 
    111     void showHelp(CodeView codeview, String s) 
    112     { 
    113         writefln("LanguageMakefile: show Help %s", s.toString()); 
    114     } 
     100      
    115101} 
  • trunk/src/leds/LanguageMakefile.d

    r153 r186  
    1717    private import dool.String; 
    1818     
    19     this(Workspace ws
     19    this(CodeView codeview
    2020    { 
    21         super(ws); 
    22     } 
     21        super(codeview); 
     22    }  
    2323     
    2424    static void setProps(Properties props) 
     
    2626        // do nothing - there are no opts for Makefile yet.. 
    2727    } 
    28     void addFolds(CodeView codeview) 
    29     { 
    30          
    31     } 
    32      
    33     String[] getLookupList(CodeView codeview, inout String start) 
    34     { 
    35         String[] ret; 
    36         return ret; 
    37     } 
    38      
    39     bit checkSyntax(CodeView codeview) 
    40     { 
    41         return true; 
    42     } 
    43      
     28      
     29       
     30     
    4431    void setLex(Scintilla scintilla) 
    4532    { 
    4633        scintilla.send(SCI_SETLEXER, SCLEX_MAKEFILE, 0); 
    4734    } 
    48     void showHelp(CodeView codeview, String s) 
    49     { 
    50         writefln("LanguageMakefile: show Help %s", s.toString()); 
    51     } 
     35      
    5236} 
  • trunk/src/leds/LanguagePHP.d

    r176 r186  
    4949    static d_time cachedModuleReadTime; 
    5050     
    51     Element getCachedElementBase(CodeView codeview, char[][] imports) 
     51    Element getCachedElementBase(char[][] imports) 
    5252    { 
    5353        bool usecache = true; 
     
    9292    } 
    9393     
     94    this(CodeView codeview) 
     95    { 
     96        super(codeview); 
     97    }  
     98     
    9499      
    95      
    96     this(Workspace ws) 
    97     { 
    98         super(ws); 
    99     } 
    100      
    101100    static void setProps(Properties props) 
    102101    { 
     
    162161    } 
    163162     
    164     void loadBrowserData(FileView fileView, BrowserView bv) 
    165     { 
    166         if (!(cast(CodeView)fileView)) { 
    167             return; 
    168         } 
    169         Element sourceModule = getCachedElementBase( cast(CodeView)fileView, getImports(cast(CodeView)fileView)); 
     163    void loadBrowserData(BrowserView bv) 
     164    { 
     165     
     166        Element sourceModule = getCachedElementBase( getImports()); 
    170167        if (!sourceModule ) { 
    171168            return; 
     
    206203     
    207204     
    208     char[][] getImports(CodeView codeview
     205    char[][] getImports(
    209206    { 
    210207        char[][] imports; 
     
    219216     
    220217     
    221     void addFolds(CodeView codeview
     218    void addFolds(
    222219    { 
    223220        BrowserView bv = codeview.getWorkspace().getBrowserView(); 
    224          
    225           
    226         // load Imports 
    227          
    228          
    229         phpElementBase = getCachedElementBase( codeview , getImports(codeview) ); 
    230          
    231          
    232       
     221        phpElementBase = getCachedElementBase(getImports() ); 
    233222        // fixme!  
    234223        if (phpElementBase is null) { 
     
    236225        } 
    237226        //phpElementBase.dumpAll(); 
    238         this.addFoldsElementPhp(codeview, phpElementBase, 0); 
     227        this.addFoldsElementPhp(phpElementBase, 0); 
    239228         
    240229    } 
     
    243232     * recursively iterate through elements, and add folds. 
    244233     */ 
    245     void addFoldsElementPhp(CodeView codeview, Element pe, int foldOffset) 
     234    void addFoldsElementPhp(Element pe, int foldOffset) 
    246235    { 
    247236      
     
    261250        } 
    262251        foreach(Element elementChild ; pe.elements) { 
    263                addFoldsElementPhp(codeview, elementChild,newFoldOffset); 
     252               addFoldsElementPhp(elementChild,newFoldOffset); 
    264253        } 
    265254    } 
     
    271260     * This still needs more work, as typing a space causes a reparse.. 
    272261     */ 
    273     bool canAutoComplete(CodeView codeview
     262    bool canAutoComplete(
    274263    { 
    275264         
     
    297286     
    298287     
    299     String[] getLookupList(CodeView codeview, inout String start) 
     288    String[] getLookupList(inout String start) 
    300289    { 
    301290        String[] list; 
     
    330319         
    331320         
    332         phpElementBase = getCachedElementBase( codeview , imports ); 
     321        phpElementBase = getCachedElementBase( imports ); 
    333322         
    334323        //phpElementBase.dumpAll(); 
     
    549538     
    550539     
    551     bit checkSyntax(CodeView codeview
     540    bit checkSyntax(
    552541    { 
    553542        //debug(flow ) System.writefln("CodeView.checkSintax 1"); 
     
    575564        //debug(flow ) System.writefln("CodeView.checkSintax 8"); 
    576565        //writefln("RETURNED: %s, %s",spawn.getOutputString(), spawn.getErrorString()); 
    577         this.checkSyntax(codeview,spawn.getOutputString(), spawn.getErrorString()); 
     566        this.checkSyntax(spawn.getOutputString(), spawn.getErrorString()); 
    578567        //workspace.getStatusbar().addBackgroundProcess(); 
    579568        //debug(flow ) System.writefln("CodeView.checkSintax 9"); 
     
    586575     
    587576     
    588     bit checkSyntax(CodeView codeview, char[] outstr, char[] errstr)  
     577    bit checkSyntax(char[] outstr, char[] errstr)  
    589578    { 
    590579        codeview.getWorkspace().getSystemConsole.print(outstr); 
     
    821810    } 
    822811     
    823     void showHelp(CodeView codeview, String s) 
     812    void showHelp(String s) 
    824813    { 
    825814         
    826815          
    827         phpElementBase = getCachedElementBase( codeview,getImports(codeview)); 
     816        phpElementBase = getCachedElementBase( getImports()); 
    828817         
    829818