Changeset 242
- Timestamp:
- 02/27/07 01:36:49 (2 years ago)
- Files:
-
- trunk/src/language/d/CodeBlock.d (modified) (18 diffs)
- trunk/src/language/d/Directory.d (modified) (2 diffs)
- trunk/src/language/d/Module.d (modified) (6 diffs)
- trunk/src/language/d/Parser.d (modified) (1 diff)
- trunk/src/leds/CodeEdit.d (modified) (1 diff)
- trunk/src/leds/CodeView.d (modified) (6 diffs)
- trunk/src/leds/Docker.d (modified) (4 diffs)
- trunk/src/leds/DockerFiles.d (modified) (1 diff)
- trunk/src/leds/DockerTools.d (modified) (1 diff)
- trunk/src/leds/Language.d (modified) (2 diffs)
- trunk/src/leds/LanguageD.d (modified) (22 diffs)
- trunk/src/leds/LanguagePHP.d (modified) (7 diffs)
- trunk/src/leds/Project.d (modified) (1 diff)
- trunk/src/leds/ProjectTargetUI.d (modified) (8 diffs)
- trunk/src/leds/Scintilla.d (modified) (2 diffs)
- trunk/src/leds/Workspace.d (modified) (4 diffs)
- trunk/src/property/Properties.d (modified) (2 diffs)
- trunk/src/property/PropertiesUI.d (modified) (5 diffs)
- trunk/src/property/Props.d (modified) (4 diffs)
- trunk/src/property/PropsUI.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/language/d/CodeBlock.d
r238 r242 1 1 module language.d.CodeBlock; 2 3 //debug=messages; 2 4 3 5 import language.d.Element; … … 76 78 CodeBlock getContainerForLine(int lineNo, bool functionOnly = false) 77 79 { 78 // writefln("checking CodeBlock for %d", lineNo);80 //debug(messages)writefln("checking CodeBlock for %d", lineNo); 79 81 //this.dumpAll(1,false); 80 82 … … 82 84 foreach(Element e;this.elements) { 83 85 if (!cast(CodeBlock)e) { 84 // writefln("Skip");86 //debug(messages)writefln("Skip"); 85 87 //e.dumpAll(1,false); 86 88 continue; 87 89 } 88 90 89 // writefln("Compare %d > %d < %d", e.startLine, lineNo, e.endLine);91 //debug(messages)writefln("Compare %d > %d < %d", e.startLine, lineNo, e.endLine); 90 92 if ((lineNo >= e.startLine ) && (lineNo <= e.endLine)) { 91 93 return (cast(CodeBlock)e).getContainerForLine(lineNo,functionOnly); 92 94 } 93 95 } 94 // writefln("returning self - only methods.");96 //debug(messages)writefln("returning self - only methods."); 95 97 if (functionOnly && !(cast(Method)this)) { 96 98 return null; … … 103 105 { 104 106 // assume without '.' 105 writefln("getAutoCompleteList called on %s:%s", this.classinfo.name,this.name);107 debug(messages)writefln("getAutoCompleteList called on %s:%s", this.classinfo.name,this.name); 106 108 if (cast(Method)this && cast(Class)this.parent && (start.length < 5)) { 107 109 if ( (!start.length) || (start == "this"[0..start.length])) { … … 119 121 Class newpc = cast(Class) pc.getTypeElement(pc.extends); 120 122 if (newpc) { 121 writefln("got parent: %s", newpc.name);123 debug(messages)writefln("got parent: %s", newpc.name); 122 124 newpc.getAutoCompleteList(start, ret, false, imports); 123 125 } else { 124 writefln("getAutoCompleteList:could not find parent: %s of class %s", pc.extends, pc.name);126 debug(messages)writefln("getAutoCompleteList:could not find parent: %s of class %s", pc.extends, pc.name); 125 127 126 128 } … … 128 130 129 131 } 130 writefln("getAutoCompleteList:: foreach on %d elements", elements.length);132 debug(messages)writefln("getAutoCompleteList:: foreach on %d elements", elements.length); 131 133 foreach (e;elements) { 132 134 writefln("testing %s", e.classinfo.name); 133 135 if (cast(Definition)e) { 134 // writefln("testing %s against %s", start,(cast(Definition)e).name);136 //debug(messages)writefln("testing %s against %s", start,(cast(Definition)e).name); 135 137 if ((cast(Definition)e).nameMatches(start)) { 136 writefln("autoComplete add Defintion %s from %s", e.name, this.name);138 debug(messages)writefln("autoComplete add Defintion %s from %s", e.name, this.name); 137 139 ret ~= new String((cast(Definition)e).name); 138 140 … … 141 143 } 142 144 if (cast(Class)e) { 143 writefln("testing %s against %s", start,(cast(Class)e).name);145 debug(messages)writefln("testing %s against %s", start,(cast(Class)e).name); 144 146 if ((cast(Class)e).nameMatches(start)) { 145 writefln("autoComplete add Class %s from %s", e.name, this.name);147 debug(messages)writefln("autoComplete add Class %s from %s", e.name, this.name); 146 148 ret ~= new String((cast(Class)e).name); 147 149 } … … 150 152 } 151 153 if (cast(Struct)e) { 152 writefln("testing %s against %s", start,(cast(Struct)e).name);154 debug(messages)writefln("testing %s against %s", start,(cast(Struct)e).name); 153 155 if ((cast(Struct)e).nameMatches(start)) { 154 writefln("autoComplete add Struct %s from %s", e.name, this.name);156 debug(messages)writefln("autoComplete add Struct %s from %s", e.name, this.name); 155 157 ret ~= new String((cast(Struct)e).name); 156 158 } … … 159 161 if (cast(Method)e && (e.getType() == FUNCTION)) { 160 162 161 writefln("testing %s(%d) against %s", start, start.length, (cast(Method)e).name);163 debug(messages)writefln("testing %s(%d) against %s", start, start.length, (cast(Method)e).name); 162 164 if ((cast(Method)e).nameMatches(start)) { 163 writefln("autoComplete add Method %s from %s", e.name, this.name);165 debug(messages)writefln("autoComplete add Method %s from %s", e.name, this.name); 164 166 ret ~= new String((cast(Method)e).name ~ "(" ~ (cast(Method)e).argsToAutoComplete() ~ ")"); 165 167 } … … 168 170 if (cast(Enum)e) { 169 171 if ((cast(Enum)e).nameMatches(start)) { 170 writefln("autoComplete add Enum %s from %s", e.name, this.name);172 debug(messages)writefln("autoComplete add Enum %s from %s", e.name, this.name); 171 173 ret ~= new String((cast(Enum)e).name); 172 174 } … … 175 177 if (imports && parents && cast(Import)e) { 176 178 // assumes we dont have multiple references to it.. 177 writefln("in %s trying to load import %s", this.name, e.name);179 debug(messages)writefln("in %s trying to load import %s", this.name, e.name); 178 180 Module m = (cast(Import)e).load(); 179 181 if (m) { … … 233 235 } 234 236 235 writefln("looking up definition of %s on %s/%s", match, this.classinfo.name, this.name);237 debug(messages)writefln("looking up definition of %s on %s/%s", match, this.classinfo.name, this.name); 236 238 237 239 … … 246 248 continue; 247 249 } 248 // writefln("testing %s against %s", match,(cast(Definition)e).name);250 //debug(messages)writefln("testing %s against %s", match,(cast(Definition)e).name); 249 251 if (e.name == match.toString()) { 250 252 retElements ~= e; … … 271 273 Class newpc = cast(Class) pc.getTypeElement(pc.extends); 272 274 if (newpc) { 273 writefln("getDefinitionElement:got parent: %s", newpc.name);275 debug(messages)writefln("getDefinitionElement:got parent: %s", newpc.name); 274 276 Element e = newpc.getDefinitionElement(match, false); 275 277 if (e) { … … 281 283 } 282 284 } else { 283 writefln("getDefinitionElement:could not find parent: %s of class %s", pc.extends, pc.name);285 debug(messages)writefln("getDefinitionElement:could not find parent: %s of class %s", pc.extends, pc.name); 284 286 285 287 } … … 309 311 if (cast(Module)this && parents) { 310 312 foreach(importdir; (cast(Module)this).paths) { 311 writefln("checking Filepath %s against %s", importdir, match);313 debug(messages)writefln("checking Filepath %s against %s", importdir, match); 312 314 Directory d = new Directory(this, importdir.toString()); 313 315 Element e = d.getDefinitionElement(match); … … 326 328 327 329 if (cast(Module)this) { 328 writefln("hit module - giving up");330 debug(messages)writefln("hit module - giving up"); 329 331 return; 330 332 } 331 333 if (!parents) { // for single level quering.. 332 writefln("hit no parents - giving up");334 debug(messages)writefln("hit no parents - giving up"); 333 335 return; 334 336 } … … 364 366 365 367 if (cast(Class)e) { 366 writefln("getTypeElement:testing %s against %s", match,(cast(Class)e).name);368 debug(messages)writefln("getTypeElement:testing %s against %s", match,(cast(Class)e).name); 367 369 if ((cast(Class)e).name == match) { 368 370 return e; trunk/src/language/d/Directory.d
r232 r242 1 1 module language.d.Directory; 2 3 //debug=messages; 2 4 3 5 import language.d.Element; … … 136 138 Element getDefinitionElement(String match, bool parents = true, bool imports=true) 137 139 { 138 writefln("Directory::getDefinitionElement match? %s to path ing %s", match, name);140 debug(messages)writefln("Directory::getDefinitionElement match? %s to path ing %s", match, name); 139 141 String fp = Path.join(this.name, match); 140 142 141 143 if (checkPathIsDir(fp)) { 142 writefln("Matched - returning new directory");144 debug(messages)writefln("Matched - returning new directory"); 143 145 return new Directory(this, fp.toString()); 144 146 } trunk/src/language/d/Module.d
r189 r242 19 19 module language.d.Module; 20 20 21 //debug=messages; 21 22 22 23 private import std.stdio; … … 52 53 static Module loadFromFile(char[] filename, String[] paths) 53 54 { 54 // writefln("load From File: %s", filename);55 //debug(messages)writefln("load From File: %s", filename); 55 56 return Module.loadFromCache(filename, paths); 56 57 57 // writefln("failed to load '%s', using search path '%s'" ,filename, std.string.join(paths,":"));58 //debug(messages)writefln("failed to load '%s', using search path '%s'" ,filename, std.string.join(paths,":")); 58 59 return null; 59 60 } … … 62 63 if (fileWithPath in Module.cacheMtimes) { 63 64 // it's in the cache. 64 // writefln("file in cache:" ~ fileWithPath);65 //debug(messages)writefln("file in cache:" ~ fileWithPath); 65 66 if (Module.cacheMtimes[fileWithPath] >= dool.io.Path.Path.getMTime(new String(fileWithPath))) { 66 67 // then the file is cached and our mtime is greater than the real file. … … 69 70 70 71 } 71 // writefln("file not in cache:" ~ fileWithPath);72 //debug(messages)writefln("file not in cache:" ~ fileWithPath); 72 73 // otherwise we need to load it.. 73 74 … … 82 83 static Module loadFromString(char[] string, char[] fileWithPath, String[] paths) 83 84 { 84 // writefln("file not in cache:" ~ fileWithPath);85 //debug(messages)writefln("file not in cache:" ~ fileWithPath); 85 86 // otherwise we need to load it.. 86 87 … … 107 108 this.pos = 0; // so we dont skip first bit.. 108 109 this.moduleObj = this; 109 writefln("module %s", this.filename);110 debug(messages)writefln("module %s", this.filename); 110 111 //super(this,-1); 111 112 super(this); trunk/src/language/d/Parser.d
r241 r242 376 376 // should we just ignore this? - or just overlay inot the current scope.. 377 377 378 tokensUpto('(' );378 tokensUpto('(', '='); 379 379 380 380 trunk/src/leds/CodeEdit.d
r230 r242 146 146 147 147 /** 148 * Get the current character position on the document148 * Gets the current character position on the document 149 149 * @return 150 150 */ trunk/src/leds/CodeView.d
r230 r242 98 98 private import gtkc.gtktypes; 99 99 private import gtkc.gdktypes; 100 101 private import language.d.Element; 102 private import language.d.Module; 103 private import language.d.Directory; 104 private import language.d.CodeBlock; 105 106 100 107 //debug=notify 101 108 … … 1360 1367 body 1361 1368 { 1362 1369 writefln("gotoElement 1"); 1363 1370 if ( elementName is null || elementName.length == 0 ) 1364 1371 { 1372 writefln("gotoElement 2"); 1365 1373 return false; 1366 1374 } 1375 writefln("gotoElement 3"); 1367 1376 Language lang = this.getLanguageHandler(); 1377 writefln("gotoElement 4"); 1368 1378 1369 1379 String[] fileandNum = lang.getElementLocation(elementName, lineNumber); 1370 if (!fileandNum.length) { 1380 writefln("gotoElement 5"); 1381 if (!fileandNum.length) 1382 { 1383 writefln("gotoElement 6"); 1371 1384 return false; 1372 1385 } 1386 writefln("gotoElement 7"); 1373 1387 std.stdio.writefln("goto: " ~ fileandNum[0] ~ " :: " ~ fileandNum[1]); 1374 1388 int toLine = atoi(fileandNum[1].toString().ptr); 1375 1389 1390 writefln("gotoElement 8"); 1376 1391 CodeView cv = cast(CodeView)workspace.openFile(fileandNum[0]); 1377 if ( cv is null) { 1392 if ( cv is null) 1393 { 1394 writefln("gotoElement 9"); 1378 1395 return false; 1379 1396 } 1380 1397 cv.gotoLine(toLine+1); 1398 writefln("gotoElement 10"); 1381 1399 return true; 1382 1400 … … 1556 1574 1557 1575 //printf("mouse pressed on CodeView with button %d and time %d\n",eventButton.button,eventButton.time); 1558 if (eventButton.button != 1) { 1576 if (eventButton.button != 1) 1577 { 1559 1578 return false; 1560 1579 } 1561 if (!Leds.leds.getPropValue("autoHelp",false) ) { 1580 if (!Leds.leds.getPropValue("autoHelp",false) ) 1581 { 1562 1582 return false; 1563 1583 } 1564 1584 1585 if ( codeEdit.isAutoCompletionActive() ) 1586 { 1587 return false; 1588 } 1589 1565 1590 auto str = getLeftRightId(); 1566 1591 if (!str.length) { … … 1582 1607 void openModule(MenuItem item) 1583 1608 { 1584 if (!codeEdit.getSelected().length) { 1585 return false; 1586 } 1587 1588 String[] fileandNum = getLanguageHandler().getElementLocation(codeEdit.getSelected(), codeEdit.getCurrLine()); 1589 if (!fileandNum.length) { 1609 writefln("openModule 0.0"); 1610 String token = codeEdit.getSelected(); 1611 if ( token.length == 0 ) 1612 { 1613 return; // or find the position of the mouse click on the text before: 1614 //token = getLeftRightId(); 1615 } 1616 1617 writefln("openModule 0.1"); 1618 String[] fileandNum = getLanguageHandler().getElementLocation( 1619 token, codeEdit.getCurrLine()); 1620 1621 1622 LanguageD language = cast(LanguageD)getLanguageHandler(); 1623 1624 Module sourceModule = language.getCachedModule(); 1625 CodeBlock container = sourceModule.getContainerForLine(getLineNumber()); 1626 1627 writefln("openModule 0.2"); 1628 if (!container) 1629 { 1630 popupTip("no container found?"); 1631 writefln("openModule 0.3"); 1632 return; 1633 } 1634 1635 String[] bits = token.split("."); 1636 1637 writefln("openModule 0.4"); 1638 if (bits.length < 2) 1639 { 1640 writefln("openModule 0.5"); 1641 // simple single entity. 1642 Element[] types; 1643 container.getDefinitionElementAll(token,types); 1644 if (types.length > 0 ) 1645 { 1646 writefln("openModule 0.6"); 1647 popupTip(types[0].getHelp()); 1648 // char[] str = ""; 1649 // foreach(type;types) 1650 // { 1651 // str ~= (str.length ? "\n" : "") ~ type.getHelp().toString(); 1652 // } 1653 // help ~= "#2" ~ str~"\n\n"; 1654 // //codeview.getWorkspace().getSystemConsole.print(str); 1655 } 1656 else 1657 { 1658 writefln("openModule 0.7"); 1659 popupTip("no types found"); 1660 } 1661 return; 1662 } 1663 else 1664 { 1665 writefln("openModule 1"); 1666 Element lookupwith = null; 1667 1668 for(int i=0;i< bits.length-1; i++) 1669 { 1670 writefln("openModule 2"); 1671 Element type = null; 1672 if (!lookupwith) 1673 { 1674 type = container.getDefinitionElement(bits[i]); 1675 } 1676 else 1677 { 1678 type = lookupwith.getDefinitionElement(bits[i], false); // dont go up tree. 1679 } 1680 1681 if (!type) 1682 { 1683 debug(messages)writefln("cant find defintion of item named %s" , bits[i]); 1684 writefln("openModule 3"); 1685 return; 1686 } 1687 1688 // got a parent 1689 container = type.moduleObj; 1690 lookupwith = container.getTypeElement(type); 1691 1692 if (!lookupwith) 1693 { 1694 debug(messages)writefln("cant find defintion of type %s" , type.returnType); 1695 writefln("openModule 4"); 1696 return; 1697 } 1698 } 1699 1700 token = bits[bits.length-1]; 1701 debug(messages)writefln("building help for '%s' from %s ", s, lookupwith.classinfo.name); 1702 //lookupwith.dumpAll(1); 1703 1704 //debug(messages)writefln("got %d elements", list.length); 1705 1706 writefln("openModule 5"); 1707 if ( !token.length || !cast(CodeBlock)lookupwith ) 1708 { 1709 if (cast(Directory)lookupwith && token.length) 1710 { 1711 Element de = lookupwith.getDefinitionElement(token); 1712 if (de) 1713 { 1714 popupTip("#3" ~ de.getHelp().toString()~"\n\n"); 1715 //codeview.getWorkspace().getSystemConsole.print(de.getHelp()); 1716 } 1717 writefln("openModule 6"); 1718 return; 1719 } 1720 writefln("openModule 7"); 1721 return; 1722 } 1723 1724 Element[] types; 1725 (cast(CodeBlock)lookupwith).getDefinitionElementAll(token,types,false); 1726 // last item was a '.' 1727 1728 writefln("openModule 8"); 1729 if ( types ) 1730 { 1731 writefln("openModule 9"); 1732 char[] str = ""; 1733 foreach( type ; types ) 1734 { 1735 str ~= (str.length ? "\n" : "") ~ type.getHelp().toString(); 1736 } 1737 popupTip("#4" ~ str~"\n\n"); 1738 //codeview.getWorkspace().getSystemConsole.print(str); 1739 } 1740 } 1741 1742 1743 1744 if ( fileandNum.length == 0) 1745 { 1746 writefln("openModule 5"); 1590 1747 return false; 1591 1748 } … … 2213 2370 void fireAutoCompletion() 2214 2371 { 2372 writefln("CodeView.fireAutoCompletion entry"); 2215 2373 if ( userShortCuts() ) { 2216 2374 return; … … 2770 2928 } 2771 2929 2930 void popupTip(String tip, int position=-1) 2931 { 2932 if ( !codeEdit.isAutoCompletionActive() ) 2933 { 2934 if ( position < 0 ) 2935 { 2936 position = codeEdit.getCurrentPos(); 2937 } 2938 tip.replace("\n\r", "\n"); 2939 2940 codeEdit.callTipShow(position, tip); 2941 } 2942 } 2943 2944 void popupTip(char[] tip, int position=-1) 2945 { 2946 popupTip(new String(tip), position); 2947 } 2948 2772 2949 /** 2773 2950 * This notification is sent when the text or styling of the document changes or is about to change. trunk/src/leds/Docker.d
r230 r242 134 134 135 135 notebook = new Notebook; 136 notebook.setGroupId(getDockerID()); 136 137 //notebook.setShowTabs(false); 137 138 notebook.popupEnable(); … … 145 146 } 146 147 148 public int getDockerID() 149 { 150 return 0; 151 } 152 147 153 Widget getWidget() 148 154 { … … 336 342 // insert before this. 337 343 notebook.insertPageMenu(dockable.getWidget(), tabLabel, menuLabel, i); 338 //notebook.setTabReorderable(dockable.getWidget(), true); 344 notebook.setTabReorderable(dockable.getWidget(), true); 345 notebook.setTabDetachable(dockable.getWidget(), true); 339 346 inserted = true; 340 347 break; … … 349 356 { 350 357 notebook.appendPageMenu(dockable.getWidget(), tabLabel, menuLabel); 351 //notebook.setTabReorderable(dockable.getWidget(), true); 358 notebook.setTabReorderable(dockable.getWidget(), true); 359 notebook.setTabDetachable(dockable.getWidget(), true); 352 360 } 353 361 trunk/src/leds/DockerFiles.d
r230 r242 89 89 } 90 90 91 public int getDockerID() 92 { 93 return 1; 94 } 95 91 96 public Widget getSuperWidget() 92 97 { trunk/src/leds/DockerTools.d
r230 r242 74 74 } 75 75 76 public int getDockerID() 77 { 78 return 0; 79 } 80 76 81 Widget getWidget() 77 82 { trunk/src/leds/Language.d
r230 r242 26 26 import dool.String; 27 27 import dool.io.Path; 28 import leds.Leds; 28 29 import leds.CodeView; 29 30 import leds.CodeEdit; … … 272 273 } 273 274 275 /** 276 * requests our codeview to display a help message 277 * param: help The help messages 278 */ 279 protected void displayHelp(char[] help) 280 { 281 while ( help.length > 0 && help[$-1] == '\n' ) 282 { 283 help.length = help.length - 1; 284 } 285 if ( help.length > 0 ) 286 { 287 if ( Leds.leds.getPropValue("helpOnOutput", true) ) 288 { 289 codeview.getWorkspace().getSystemConsole.print(help); 290 } 291 else 292 { 293 codeview.popupTip(help); 294 } 295 } 296 } 297 298 274 299 } trunk/src/leds/LanguageD.d
r240 r242 1 1 module leds.LanguageD; 2 3 //debug=messages; 4 2 5 import leds.Language; 3 6 … … 123 126 124 127 if (!sourceModule ) { 125 // writefln("loadBrowserData - no sourceModule?");128 //debug(messages)writefln("loadBrowserData - no sourceModule?"); 126 129 return; 127 130 } 128 // writefln("loadBrowserData - loadig Element?");131 //debug(messages)writefln("loadBrowserData - loadig Element?"); 129 132 addBrowserElements(bv, null, sourceModule); 130 133 … … 135 138 private void addBrowserElements(BrowserView bv, TreeIter parentIter, Element element) 136 139 { 137 // writefln("Adding element: %s", element.getBrowserForm().toString);140 // debug(messages)writefln("Adding element: %s", element.getBrowserForm().toString); 138 141 TreeIter newIter = bv.addGenericElement( 139 142 parentIter, … … 290 293 case "invariant" : pixDef = Pixmaps.greenInvariant_xpm; break; 291 294 default: 292 writefln("BrowserView.getPixbuf.BLOCK.default ", element.returnType.toString());295 debug(messages)writefln("BrowserView.getPixbuf.BLOCK.default ", element.returnType.toString()); 293 296 pixDef = Pixmaps.red_xpm; 294 297 break; … … 347 350 void addFoldsElement(Element element, int foldOffset, bool collapse) 348 351 { 352 /* 353 debug(messages)writefln("got Element: ", 354 " Form: ", element.getBrowserForm().toString, // definition. 355 " Modifiers: ", element.getModifiers().toString, // return type 356 " Element: ", RowType.ELEMENT, 357 " Type: ", new String(cast(int)element.getType()), 358 " Line: ", new String(element.getLineInCode()), 359 "-", new String(element.getLastLineInCode()), 360 "" 361 ); */ 362 363 /* Types: 364 22 = The file? 365 2 = import 366 3 = enum 367 6 = var? 368 9 = version? 369 17 = interface? 370 20 = class? 371 21 = method 372 */ 373 int newFoldOffset = foldOffset; 374 //if (element.endLine > 0 && ( 349 375 if ((element.endLine > 0) && (element.startLine >= foldActiveLine) && ( 350 376 (element.getType() == Element.CLASS) || … … 406 432 auto tokenizer = new Tokenizer( codeview.getText().toString()); 407 433 tokenizer.parse(); 408 // writefln("find token at = %d", codeview.getCurrentPos());434 //debug(messages)writefln("find token at = %d", codeview.getCurrentPos()); 409 435 int toktype = tokenizer.tokenTypeAtPos( codeview.getCurrentPos()); 410 // writefln("toktype = %d", toktype);436 //debug(messages)writefln("toktype = %d", toktype); 411 437 412 438 canAutoCompleteLastRet = (toktype != Token.STRING) && (toktype != Token.COMMENT); … … 428 454 429 455 foreach(str,tokval;Token.stdKeyword) { 430 // writefln("test %s", str);456 //debug(messages)writefln("test %s", str); 431 457 if (start.length < str.length) { 432 458 if (str[0..start.length] == start) { … … 440 466 CodeBlock container = sourceModule.getContainerForLine(codeview.getLineNumber()); 441 467 if (!container) { 442 writefln("no container found?");468 debug(messages)writefln("no container found?"); 443 469 return list; 444 470 } 445 471 String[] bits = start.split("."); 446 writefln("bits leng = %d", bits.length);472 debug(messages)writefln("bits leng = %d", bits.length); 447 473 if (bits.length < 2) { 448 474 // simple single entity. … … 461 487 } 462 488 if (!type) { 463 writefln("cant find defintion of item named %s" , bits[i]);489 debug(messages)writefln("cant find defintion of item named %s" , bits[i]); 464 490 return list; 465 491 } … … 472 498 } 473 499 if (!lookupwith) { 474 writefln("cant find defintion of type %s" , type.returnType);500 debug(messages)writefln("cant find defintion of type %s" , type.returnType); 475 501 return list; 476 502 } … … 478 504 479 505 start = bits[bits.length-1]; 480 writefln("building autocomplete list for '%s' on %s", start, lookupwith.classinfo.name);506 debug(messages)writefln("building autocomplete list for '%s' on %s", start, lookupwith.classinfo.name); 481 507 //lookupwith.dumpAll(1); 482 508 lookupwith.getAutoCompleteList(start, list, false); 483 // writefln("got %d elements", list.length);509 //debug(messages)writefln("got %d elements", list.length); 484 510 if (start.length) { 485 511 return list; … … 505 531 } 506 532 foreach(s;searchin) { 507 // writefln("compare %s to %s", s,start);533 // debug(messages)writefln("compare %s to %s", s,start); 508 534 if (s.length < start.length()) { 509 535 continue; … … 512 538 continue; 513 539 } 514 // writefln("adding: %s", s[start.length..length]);540 //debug(messages)writefln("adding: %s", s[start.length..length]); 515 541 ret ~= s.dup; 516 542 } … … 578 604 579 605 auto l = Leds.leds().getPropValue("dmd","dmd"); 580 writefln("getPropValue(\"dmd\",\"dmd\") = ", l); 581 582 606 debug(messages)writefln("getPropValue(\"dmd\",\"dmd\") = ", l); 607 608 // dmd doesn't need to be a file if it's on the executables path 609 // if (!Path.isFile(l)) 610 // { 611 // //debug(messages)writefln("dmd command does not exist"); 612 // codeview.getWorkspace().getSystemConsole.print( 613 // "Can not find dmd '" ~ l.toString() ~ "' so compile test does not work\n"); 614 // return correct; 615 // } 583 616 584 617 version(Win32) … … 867 900 { 868 901 // tidy it up.. 869 902 903 char[] help; 904 870 905 String[] strs = s.split("("); 871 906 s = strs.length ? strs[0] : new String(""); 872 if (!s.length) { 907 908 if ( s.length == 0 ) 909 { 873 910 return; 874 911 } 875 if (s.toString() in Token.stdKeyword) { 876 codeview.getWorkspace().getSystemConsole.print("D Keyword: " ~ s.toString()); 912 913 if (s.toString() in Token.stdKeyword) 914 { 915 help ~= "@1" ~ "D Keyword: " ~ s.toString()~"\n\n"; 916 //codeview.getWorkspace().getSystemConsole.print("D Keyword: " ~ s.toString()); 877 917 return; 878 918 } 879 880 919 881 920 Module sourceModule = this.getCachedModule(); 882 921 CodeBlock container = sourceModule.getContainerForLine(codeview.getLineNumber()); 883 if (!container) { 884 writefln("no container found?"); 922 923 if (!container) 924 { 925 debug(messages)writefln("no container found?"); 926 displayHelp(help); 885 927 return; 886 928 } 929 887 930 String[] bits = s.split("."); 888 writefln("bits leng = %d", bits.length); 889 if (bits.length < 2) { 931 debug(messages)writefln("bits leng = %d", bits.length); 932 933 if (bits.length < 2) 934 { 890 935 // simple single entity. 891 936 Element[] types; … … 893 938 if (types) { 894 939 char[] str = ""; 895 foreach(type;types) { 940 foreach(type;types) 941 { 896 942 str ~= (str.length ? "\n" : "") ~ type.getHelp().toString(); 897 943 } 898 codeview.getWorkspace().getSystemConsole.print(str); 899 } 944 help ~= "@2" ~ str~"\n\n"; 945 //codeview.getWorkspace().getSystemConsole.print(str); 946 } 947 displayHelp(help); 900 948 return; 901 949 } 950 902 951 // do lookup on '*.*' 903 952 904 953 Element lookupwith = null; 905 for(int i=0;i< bits.length-1; i++) { 954 955 for(int i=0;i< bits.length-1; i++) 956 { 906 957 Element type = null; 907 if (!lookupwith) { 958 if (!lookupwith) 959 { 908 960 type = container.getDefinitionElement(bits[i]); 909 } else { 961 } 962 else 963 { 910 964
