Compare commits

..

No commits in common. "master" and "v0.8.13" have entirely different histories.

26 changed files with 190 additions and 215 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "deps/DCD"]
path = deps/DCD
url = https://github.com/Hackerpilot/DCD.git

1
deps/DCD vendored Submodule

@ -0,0 +1 @@
Subproject commit cbcc6faac3f820bb8e06ed132d82d13036e34d58

View File

@ -12,8 +12,9 @@
"stringImportPaths": ["views"], "stringImportPaths": ["views"],
"dependencies": { "dependencies": {
"dlangui": "~>0.10.3", "dlangui": "==0.9.179",
"dcd": "~>0.16.0-beta.1" "dsymbol": "~>0.2.9",
"dcd": "~>0.9.1"
}, },
"copyFiles-windows": [ "copyFiles-windows": [

View File

@ -69,7 +69,7 @@ class BasicTypeX : Lexem {
in { in {
assert(isBasicTypeXToken(token)); assert(isBasicTypeXToken(token));
} }
do { body {
_token = token; _token = token;
} }
} }
@ -97,7 +97,7 @@ class TypeCtor : Lexem {
in { in {
assert(isTypeCtorToken(token)); assert(isTypeCtorToken(token));
} }
do { body {
_token = token; _token = token;
} }
} }
@ -112,14 +112,14 @@ class TypeCtors : Lexem {
in { in {
assert(isTypeCtorToken(token)); assert(isTypeCtorToken(token));
} }
do { body {
_list ~= new TypeCtor(token); _list ~= new TypeCtor(token);
} }
public void append(Token token) public void append(Token token)
in { in {
assert(isTypeCtorToken(token)); assert(isTypeCtorToken(token));
} }
do { body {
_list ~= new TypeCtor(token); _list ~= new TypeCtor(token);
} }
} }
@ -134,7 +134,7 @@ class Identifier : Lexem {
in { in {
assert(identifier.type == TokenType.IDENTIFIER); assert(identifier.type == TokenType.IDENTIFIER);
} }
do { body {
_token = cast(IdentToken)identifier; _token = cast(IdentToken)identifier;
} }
} }
@ -157,14 +157,14 @@ class IdentifierList : Lexem {
in { in {
assert(ident.type == TokenType.IDENTIFIER); assert(ident.type == TokenType.IDENTIFIER);
} }
do { body {
_identifier = new Identifier(ident); _identifier = new Identifier(ident);
_identifierList = identifierList; _identifierList = identifierList;
} }
public this(TemplateInstance templateInstance, IdentifierList identifierList = null) public this(TemplateInstance templateInstance, IdentifierList identifierList = null)
in { in {
} }
do { body {
_templateInstance = templateInstance; _templateInstance = templateInstance;
_identifierList = identifierList; _identifierList = identifierList;
} }
@ -181,7 +181,7 @@ class TemplateInstance : Lexem {
public this() public this()
in { in {
} }
do { body {
} }
} }
@ -207,7 +207,7 @@ class BasicType : Lexem {
public this() public this()
in { in {
} }
do { body {
} }
} }
@ -228,7 +228,7 @@ class Typeof : Lexem {
public this(Expression expression) public this(Expression expression)
in { in {
} }
do { body {
_expression = expression; _expression = expression;
} }
} }
@ -245,7 +245,7 @@ class Type : Lexem {
public this() public this()
in { in {
} }
do { body {
} }
} }
@ -259,7 +259,7 @@ class Expression : Lexem {
public this() public this()
in { in {
} }
do { body {
} }
} }
@ -273,7 +273,7 @@ class AltDeclarator : Lexem {
public this() public this()
in { in {
} }
do { body {
} }
} }

View File

@ -6,15 +6,7 @@ import std.conv;
import dlangide.ui.frame; import dlangide.ui.frame;
import dlangide.ui.commands; import dlangide.ui.commands;
import dlangide.workspace.workspace; import dlangide.workspace.workspace;
static if(__VERSION__ > 2100)
{
import std.logger;
}
else
{
import std.experimental.logger; import std.experimental.logger;
}
mixin APP_ENTRY_POINT; mixin APP_ENTRY_POINT;
@ -34,20 +26,18 @@ extern (C) int UIAppMain(string[] args) {
runParserTests(); runParserTests();
} }
static if(__VERSION__ > 2100) { version(Windows) {
debug {
sharedLog = cast(shared)new FileLogger("dcd.log");
} else {
sharedLog = cast(shared)new NullLogger();
}
}
else
{
debug { debug {
sharedLog = new FileLogger("dcd.log"); sharedLog = new FileLogger("dcd.log");
} else { } else {
sharedLog = new NullLogger(); sharedLog = new NullLogger();
} }
} else {
debug {
//sharedLog = new FileLogger("dcd.log");
} else {
sharedLog = new NullLogger();
}
} }
//version (Windows) { //version (Windows) {

View File

@ -15,10 +15,15 @@ import std.experimental.allocator;
import std.experimental.allocator.mallocator; import std.experimental.allocator.mallocator;
import std.experimental.allocator.gc_allocator; import std.experimental.allocator.gc_allocator;
import dcd.server.autocomplete; import server.autocomplete;
import dcd.common.messages; import common.messages;
import dsymbol.modulecache; import dsymbol.modulecache;
//alias SharedASTAllocator = CAllocatorImpl!(Mallocator);
//alias SharedASTAllocator = CAllocatorImpl!(Mallocator);
//alias SharedASTAllocator = CSharedAllocatorImpl!(Mallocator);
alias SharedASTAllocator = ASTAllocator;
enum DCDResult : int { enum DCDResult : int {
SUCCESS, SUCCESS,
NO_RESULT, NO_RESULT,
@ -87,9 +92,11 @@ class DCDTask {
} }
class ModuleCacheAccessor { class ModuleCacheAccessor {
import dsymbol.modulecache;
//protected ASTAllocator _astAllocator;
protected ModuleCache _moduleCache; protected ModuleCache _moduleCache;
this(in string[] importPaths) { this(in string[] importPaths) {
_moduleCache = ModuleCache(); _moduleCache = ModuleCache(new SharedASTAllocator);
_moduleCache.addImportPaths(importPaths); _moduleCache.addImportPaths(importPaths);
} }
protected ModuleCache * getModuleCache(in string[] importPaths) { protected ModuleCache * getModuleCache(in string[] importPaths) {
@ -102,6 +109,8 @@ class ModuleCacheAccessor {
class DCDInterface : Thread { class DCDInterface : Thread {
import dsymbol.modulecache; import dsymbol.modulecache;
//protected ASTAllocator _astAllocator;
//protected ModuleCache * _moduleCache;
ModuleCacheAccessor _moduleCache; ModuleCacheAccessor _moduleCache;
protected BlockingQueue!DCDTask _queue; protected BlockingQueue!DCDTask _queue;
@ -229,7 +238,7 @@ class DCDInterface : Thread {
override void performRequest() { override void performRequest() {
AutocompleteResponse response = getDoc(request, *getModuleCache(_importPaths)); AutocompleteResponse response = getDoc(request, *getModuleCache(_importPaths));
//result.docComments = response.docComments.dup; TODO_GRIM: Fix result.docComments = response.docComments.dup;
result.result = DCDResult.SUCCESS; result.result = DCDResult.SUCCESS;
debug(DCD) Log.d("DCD doc comments:\n", result.docComments); debug(DCD) Log.d("DCD doc comments:\n", result.docComments);
@ -309,9 +318,11 @@ class DCDInterface : Thread {
result.output.length = response.completions.length; result.output.length = response.completions.length;
int i=0; int i=0;
foreach(s;response.completions) { foreach(s;response.completions) {
char type = s.kind; char type = 0;
if (i < response.completionKinds.length)
type = response.completionKinds[i];
result.output[i].kind = type; result.output[i].kind = type;
result.output[i].name = to!dstring(s.identifier); result.output[i].name = to!dstring(s);
i++; i++;
} }
if (response.completionType == "calltips") { if (response.completionType == "calltips") {
@ -353,7 +364,6 @@ int completionTypePriority(char t) {
return 3; return 3;
case 'k': // - keyword, built-in version, scope statement case 'k': // - keyword, built-in version, scope statement
return 20; return 20;
case 'F':
case 'f': // - function or method case 'f': // - function or method
return 2; return 2;
case 'g': // - enum name case 'g': // - enum name

View File

@ -43,7 +43,7 @@ class DMDProfilerView : WidgetGroupDefaultDrawing {
class TraceFuncionGrid : StringGridWidgetBase { class TraceFuncionGrid : StringGridWidgetBase {
protected FunctionNode[] _list; protected FunctionNode[] _list;
protected UIString[] _colTitles; protected dstring[] _colTitles;
protected ulong _ticksPerSecond; protected ulong _ticksPerSecond;
this(string ID, FunctionNode[] list, ulong ticks_per_second) { this(string ID, FunctionNode[] list, ulong ticks_per_second) {
super(ID); super(ID);
@ -53,10 +53,10 @@ class TraceFuncionGrid : StringGridWidgetBase {
fullColumnOnLeft(false); fullColumnOnLeft(false);
fullRowOnTop(false); fullRowOnTop(false);
resize(4, cast(int)list.length); resize(4, cast(int)list.length);
setColTitle(0, UIString.fromRaw("Function name")); setColTitle(0, "Function name"d);
setColTitle(1, UIString.fromRaw("Called")); setColTitle(1, "Called"d);
setColTitle(2, UIString.fromRaw("F us")); setColTitle(2, "F us"d);
setColTitle(3, UIString.fromRaw("F+D us")); setColTitle(3, "F+D us"d);
showRowHeaders = false; showRowHeaders = false;
rowSelect = true; rowSelect = true;
minVisibleRows = 10; minVisibleRows = 10;
@ -80,54 +80,54 @@ class TraceFuncionGrid : StringGridWidgetBase {
buffer[i] = buf[k - i - 1]; buffer[i] = buf[k - i - 1];
return cast(dstring)buffer[0..k]; return cast(dstring)buffer[0..k];
} }
auto formatDurationTicks(ulong n) { dstring formatDurationTicks(ulong n) {
ulong v = n * 1000000 / _ticksPerSecond; ulong v = n * 1000000 / _ticksPerSecond;
return UIString.fromRaw(formatNumber(v, _numberFormatBuf[])); return formatNumber(v, _numberFormatBuf[]);
} }
/// get cell text /// get cell text
override UIString cellText(int col, int row) { override dstring cellText(int col, int row) {
import std.conv : to; import std.conv : to;
if (row < 0 || row >= _list.length) if (row < 0 || row >= _list.length)
return UIString.fromRaw(""d); return ""d;
FunctionNode entry = _list[row]; FunctionNode entry = _list[row];
switch (col) { switch (col) {
case 0: case 0:
string fn = entry.name; string fn = entry.name;
if (fn.length > 256) if (fn.length > 256)
fn = fn[0..256] ~ "..."; fn = fn[0..256] ~ "...";
return UIString.fromRaw(fn.to!dstring); return fn.to!dstring;
case 1: case 1:
return UIString.fromRaw(formatNumber(entry.number_of_calls, _numberFormatBuf)); return formatNumber(entry.number_of_calls, _numberFormatBuf);
case 2: case 2:
return formatDurationTicks(entry.function_time); return formatDurationTicks(entry.function_time);
case 3: case 3:
return formatDurationTicks(entry.function_and_descendant_time); return formatDurationTicks(entry.function_and_descendant_time);
default: default:
return UIString.fromRaw(""d); return ""d;
} }
} }
/// set cell text /// set cell text
override StringGridWidgetBase setCellText(int col, int row, UIString text) { override StringGridWidgetBase setCellText(int col, int row, dstring text) {
// do nothing // do nothing
return this; return this;
} }
/// returns row header title /// returns row header title
override UIString rowTitle(int row) { override dstring rowTitle(int row) {
return UIString.fromRaw(""d); return ""d;
} }
/// set row header title /// set row header title
override StringGridWidgetBase setRowTitle(int row, UIString title) { override StringGridWidgetBase setRowTitle(int row, dstring title) {
return this; return this;
} }
/// returns row header title /// returns row header title
override UIString colTitle(int col) { override dstring colTitle(int col) {
return _colTitles[col]; return _colTitles[col];
} }
/// set col header title /// set col header title
override StringGridWidgetBase setColTitle(int col, UIString title) { override StringGridWidgetBase setColTitle(int col, dstring title) {
_colTitles[col] = title; _colTitles[col] = title;
return this; return this;
} }

View File

@ -641,8 +641,7 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener {
return; return;
} }
// Only insert singular autocompletion if automatic autocomplete is turned off! if (suggestions.length == 1) {
if (!_settings.autoAutoComplete && suggestions.length == 1) {
insertCompletion(suggestions[0]); insertCompletion(suggestions[0]);
return; return;
} }
@ -722,25 +721,13 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener {
super.handleFocusChange(focused, receivedFocusFromKeyboard); super.handleFocusChange(focused, receivedFocusFromKeyboard);
} }
private bool isAutoCompleteKey(ref KeyEvent event) {
if((event.keyCode >= KeyCode.KEY_0 && event.keyCode <= KeyCode.KEY_Z) ||
event.keyCode == KeyCode.KEY_PERIOD ||
event.keyCode == KeyCode.BACK ||
event.text == "_")
return true;
return false;
}
protected uint _lastKeyDownCode; protected uint _lastKeyDownCode;
protected uint _periodKeyCode; protected uint _periodKeyCode;
/// handle keys: support autocompletion after . press with delay /// handle keys: support autocompletion after . press with delay
override bool onKeyEvent(KeyEvent event) { override bool onKeyEvent(KeyEvent event) {
if (event.action == KeyAction.KeyDown) if (event.action == KeyAction.KeyDown)
_lastKeyDownCode = event.keyCode; _lastKeyDownCode = event.keyCode;
if(_settings.autoAutoComplete && isAutoCompleteKey(event) && !_completionPopup) { if (event.action == KeyAction.Text && event.noModifiers && event.text==".") {
window.dispatchAction(ACTION_GET_COMPLETIONS, this);
}
else if (event.action == KeyAction.Text && event.noModifiers && event.text==".") {
_periodKeyCode = _lastKeyDownCode; _periodKeyCode = _lastKeyDownCode;
startCompletionTimer(); startCompletionTimer();
} else { } else {
@ -803,7 +790,7 @@ class CompletionPopupMenu : PopupMenu {
MenuItem updateItems() { MenuItem updateItems() {
MenuItem res = new MenuItem(); MenuItem res = new MenuItem();
foreach(i, dstring suggestion ; _suggestions) { foreach(int i, dstring suggestion ; _suggestions) {
if (_prefix.length && !suggestion.startsWith(_prefix)) if (_prefix.length && !suggestion.startsWith(_prefix))
continue; continue;
string iconId; string iconId;
@ -819,12 +806,19 @@ class CompletionPopupMenu : PopupMenu {
/// handle keys /// handle keys
override bool onKeyEvent(KeyEvent event) { override bool onKeyEvent(KeyEvent event) {
if (event.action == KeyAction.Text) { if (event.action == KeyAction.Text) {
_prefix ~= event.text;
MenuItem newItems = updateItems();
if (newItems.subitemCount == 0) {
// no matches anymore
_editor.onKeyEvent(event); _editor.onKeyEvent(event);
_editor.closeCompletionPopup(this); _editor.closeCompletionPopup(this);
return true; return true;
} else if (event.keyCode == KeyCode.ESCAPE) { } else {
_editor.closeCompletionPopup(this); _editor.onKeyEvent(event);
menuItems = newItems;
selectItem(0);
return true; return true;
}
} else if (event.action == KeyAction.KeyDown && event.keyCode == KeyCode.BACK && event.noModifiers) { } else if (event.action == KeyAction.KeyDown && event.keyCode == KeyCode.BACK && event.noModifiers) {
if (_prefix.length > _initialPrefix.length) { if (_prefix.length > _initialPrefix.length) {
_prefix.length = _prefix.length - 1; _prefix.length = _prefix.length - 1;
@ -837,8 +831,8 @@ class CompletionPopupMenu : PopupMenu {
_editor.closeCompletionPopup(this); _editor.closeCompletionPopup(this);
} }
return true; return true;
} else if ((event.action == KeyAction.KeyDown && event.keyCode == KeyCode.RETURN) || } else if (event.action == KeyAction.KeyDown && event.keyCode == KeyCode.RETURN) {
(event.action == KeyAction.KeyDown && event.keyCode == KeyCode.SPACE)) { } else if (event.action == KeyAction.KeyDown && event.keyCode == KeyCode.SPACE) {
} }
return super.onKeyEvent(event); return super.onKeyEvent(event);
} }

View File

@ -97,7 +97,7 @@ class NewFileDlg : Dialog {
TextWidget { text: OPTION_FILE_PATH } TextWidget { text: OPTION_FILE_PATH }
EditLine { id: edFilePath; text: ""; layoutWidth: fill; readOnly: true } EditLine { id: edFilePath; text: ""; layoutWidth: fill; readOnly: true }
} }
TextWidget { id: statusText; text: ""; layoutWidth: fill; textColor: 0xFF0000 } TextWidget { id: statusText; text: ""; layoutWidth: fill; textColor: #FF0000 }
} }
}); });
} catch (Exception e) { } catch (Exception e) {

View File

@ -61,7 +61,7 @@ class NewFolderDialog : Dialog {
CheckBox { id: makePackage } CheckBox { id: makePackage }
TextWidget { text: OPTION_MAKE_PACKAGE} TextWidget { text: OPTION_MAKE_PACKAGE}
} }
TextWidget { id: statusText; text: ""; layoutWidth: fill; textColor: 0xFF0000 } TextWidget { id: statusText; text: ""; layoutWidth: fill; textColor: #FF0000 }
} }
}); });
} catch (Exception e) { } catch (Exception e) {

View File

@ -362,13 +362,13 @@ class NewProjectDlg : Dialog {
project.name = toUTF32(_projectName); project.name = toUTF32(_projectName);
if (!project.save()) if (!project.save())
return setError("Cannot save project"); return setError("Cannot save project");
project.content.setting.setString("targetName", _projectName); project.content.setString("targetName", _projectName);
if (_currentTemplate.isLibrary) { if (_currentTemplate.isLibrary) {
project.content.setting.setString("targetType", "staticLibrary"); project.content.setString("targetType", "staticLibrary");
project.content.setting.setString("targetPath", "lib"); project.content.setString("targetPath", "lib");
} else { } else {
project.content.setting.setString("targetType", "executable"); project.content.setString("targetType", "executable");
project.content.setting.setString("targetPath", "bin"); project.content.setString("targetPath", "bin");
} }
if (_currentTemplate.json) if (_currentTemplate.json)
project.content.merge(_currentTemplate.json); project.content.merge(_currentTemplate.json);

View File

@ -372,11 +372,11 @@ SearchMatchList findMatches(in string filename, in dstring searchString) {
SearchMatchList match; SearchMatchList match;
match.filename = filename; match.filename = filename;
foreach(lineIndex, dstring line; content.lines) { foreach(int lineIndex, dstring line; content.lines) {
auto colIndex = line.indexOf(searchString); auto colIndex = line.indexOf(searchString);
if (colIndex != -1) { if (colIndex != -1) {
match.matches ~= SearchMatch(cast(int)lineIndex, colIndex, line); match.matches ~= SearchMatch(lineIndex, colIndex, line);
} }
} }
return match; return match;

View File

@ -126,9 +126,6 @@ SettingsPage createSettingsPages() {
StringListValue(120, "120"d), StringListValue(120, "120"d),
StringListValue(140, "140"d), StringListValue(140, "140"d),
StringListValue(150, "150"d), StringListValue(150, "150"d),
StringListValue(150, "180"d),
StringListValue(150, "200"d),
StringListValue(150, "250"d),
StringListValue(300, "300"d), StringListValue(300, "300"d),
StringListValue(400, "400"d), StringListValue(400, "400"d),
StringListValue(600, "600"d)]); StringListValue(600, "600"d)]);
@ -147,7 +144,6 @@ SettingsPage createSettingsPages() {
texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString.fromId("OPTION_SMART_INDENTS_PASTE"c)); texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString.fromId("OPTION_SMART_INDENTS_PASTE"c));
texted.addCheckbox("editors/textEditor/showWhiteSpaceMarks", UIString.fromId("OPTION_SHOW_SPACES"c)); texted.addCheckbox("editors/textEditor/showWhiteSpaceMarks", UIString.fromId("OPTION_SHOW_SPACES"c));
texted.addCheckbox("editors/textEditor/showTabPositionMarks", UIString.fromId("OPTION_SHOW_TABS"c)); texted.addCheckbox("editors/textEditor/showTabPositionMarks", UIString.fromId("OPTION_SHOW_TABS"c));
texted.addCheckbox("editors/textEditor/autoAutoComplete", UIString.fromId("OPTION_AUTO_AUTOCOMPLETE"c));
// Common page // Common page
SettingsPage common = res.addChild("common", UIString.fromId("OPTION_COMMON"c)); SettingsPage common = res.addChild("common", UIString.fromId("OPTION_COMMON"c));

View File

@ -23,7 +23,6 @@ class IDESettings : SettingsFile {
ed.setBooleanDef("smartIndentsAfterPaste", true); ed.setBooleanDef("smartIndentsAfterPaste", true);
ed.setBooleanDef("showWhiteSpaceMarks", true); ed.setBooleanDef("showWhiteSpaceMarks", true);
ed.setBooleanDef("showTabPositionMarks", true); ed.setBooleanDef("showTabPositionMarks", true);
ed.setBooleanDef("autoAutoComplete", true);
ed.setStringDef("fontFace", "Default"); ed.setStringDef("fontFace", "Default");
ed.setIntegerDef("fontSize", 11); ed.setIntegerDef("fontSize", 11);
Setting ui = uiSettings(); Setting ui = uiSettings();
@ -172,16 +171,6 @@ class IDESettings : SettingsFile {
return this; return this;
} }
/// Text editor setting, true if auto-complete is triggered on each key press
@property bool autoAutoComplete() {
return editorSettings.getBoolean("autoAutoComplete", true);
}
///
@property IDESettings autoAutoComplete(bool v) {
editorSettings.setBoolean("autoAutoComplete", v);
return this;
}
/// true if smart indents are enabled /// true if smart indents are enabled
@property bool smartIndents() { return editorSettings.getBoolean("smartIndents", true); } @property bool smartIndents() { return editorSettings.getBoolean("smartIndents", true); }
/// set smart indents enabled flag /// set smart indents enabled flag

View File

@ -11,7 +11,6 @@ import std.file;
import std.path; import std.path;
import std.process; import std.process;
import std.utf; import std.utf;
import std.ascii : isAlphaNum;
string[] includePath; string[] includePath;
@ -491,7 +490,7 @@ class Project : WorkspaceItem {
/// name /// name
override @property void name(dstring s) { override @property void name(dstring s) {
super.name(s); super.name(s);
_projectFile.setting.setString("name", toUTF8(s)); _projectFile.setString("name", toUTF8(s));
} }
/// name /// name
@ -502,7 +501,7 @@ class Project : WorkspaceItem {
/// name /// name
override @property void description(dstring s) { override @property void description(dstring s) {
super.description(s); super.description(s);
_projectFile.setting.setString("description", toUTF8(s)); _projectFile.setString("description", toUTF8(s));
} }
/// returns project's own source paths /// returns project's own source paths
@ -577,12 +576,12 @@ class Project : WorkspaceItem {
if (!isExecutable) if (!isExecutable)
return null; return null;
string exename = toUTF8(name); string exename = toUTF8(name);
exename = _projectFile.setting.getString("targetName", exename); exename = _projectFile.getString("targetName", exename);
// TODO: use targetName // TODO: use targetName
version (Windows) { version (Windows) {
exename = exename ~ ".exe"; exename = exename ~ ".exe";
} }
string targetPath = _projectFile.setting.getString("targetPath", null); string targetPath = _projectFile.getString("targetPath", null);
string exePath; string exePath;
if (targetPath.length) if (targetPath.length)
exePath = buildNormalizedPath(_filename.dirName, targetPath, exename); // int $targetPath directory exePath = buildNormalizedPath(_filename.dirName, targetPath, exename); // int $targetPath directory
@ -686,10 +685,10 @@ class Project : WorkspaceItem {
protected string[] findSourcePaths() { protected string[] findSourcePaths() {
string[] res; string[] res;
res.assumeSafeAppend; res.assumeSafeAppend;
string[] srcPaths = _projectFile.setting.getStringArray("sourcePaths"); string[] srcPaths = _projectFile.getStringArray("sourcePaths");
foreach(s; srcPaths) foreach(s; srcPaths)
addRelativePathIfExists(res, s); addRelativePathIfExists(res, s);
Setting configs = _projectFile.setting.objectByPath("configurations"); Setting configs = _projectFile.objectByPath("configurations");
if (configs) { if (configs) {
for (int i = 0; i < configs.length; i++) { for (int i = 0; i < configs.length; i++) {
Setting s = configs[i]; Setting s = configs[i];
@ -711,7 +710,7 @@ class Project : WorkspaceItem {
void processSubpackages() { void processSubpackages() {
import dlangui.core.files; import dlangui.core.files;
_subPackages.length = 0; _subPackages.length = 0;
Setting subPackages = _projectFile.setting.settingByPath("subPackages", SettingType.ARRAY, false); Setting subPackages = _projectFile.settingByPath("subPackages", SettingType.ARRAY, false);
if (subPackages) { if (subPackages) {
string p = _projectFile.filename.dirName; string p = _projectFile.filename.dirName;
for(int i = 0; i < subPackages.length; i++) { for(int i = 0; i < subPackages.length; i++) {
@ -762,7 +761,7 @@ class Project : WorkspaceItem {
// //
_mainSourceFile = null; _mainSourceFile = null;
try { try {
_name = toUTF32(_projectFile.setting.getString("name")); _name = toUTF32(_projectFile.getString("name"));
_originalName = _name; _originalName = _name;
if (_baseProjectName) { if (_baseProjectName) {
_name = _baseProjectName ~ ":" ~ _name; _name = _baseProjectName ~ ":" ~ _name;
@ -771,7 +770,7 @@ class Project : WorkspaceItem {
_name ~= "-"d; _name ~= "-"d;
_name ~= toUTF32(_dependencyVersion.startsWith("~") ? _dependencyVersion[1..$] : _dependencyVersion); _name ~= toUTF32(_dependencyVersion.startsWith("~") ? _dependencyVersion[1..$] : _dependencyVersion);
} }
_description = toUTF32(_projectFile.setting.getString("description")); _description = toUTF32(_projectFile.getString("description"));
Log.d(" project name: ", _name); Log.d(" project name: ", _name);
Log.d(" project description: ", _description); Log.d(" project description: ", _description);
@ -787,7 +786,7 @@ class Project : WorkspaceItem {
if (!_isDependency) if (!_isDependency)
loadSelections(); loadSelections();
_configurations = ProjectConfiguration.load(_projectFile.setting); _configurations = ProjectConfiguration.load(_projectFile);
Log.i("Project configurations: ", _configurations); Log.i("Project configurations: ", _configurations);
@ -843,7 +842,7 @@ class Project : WorkspaceItem {
_dependencies = newdeps; _dependencies = newdeps;
return false; return false;
} }
Setting versions = selectionsFile.setting.objectByPath("versions"); Setting versions = selectionsFile.objectByPath("versions");
if (!versions.isObject) { if (!versions.isObject) {
_dependencies = newdeps; _dependencies = newdeps;
return false; return false;
@ -935,19 +934,19 @@ class DubPackageFinder {
bool isValidProjectName(in string s) pure { bool isValidProjectName(in string s) pure {
if (s.empty) if (s.empty)
return false; return false;
return reduce!((a, b) => a && (b == '_' || b == '-' || isAlphaNum(b)))(true, s); return reduce!q{ a && (b == '_' || b == '-' || std.ascii.isAlphaNum(b)) }(true, s);
} }
bool isValidModuleName(in string s) pure { bool isValidModuleName(in string s) pure {
if (s.empty) if (s.empty)
return false; return false;
return reduce!((a, b) => a && (b == '_' || isAlphaNum(b)))(true, s); return reduce!q{ a && (b == '_' || std.ascii.isAlphaNum(b)) }(true, s);
} }
bool isValidFileName(in string s) pure { bool isValidFileName(in string s) pure {
if (s.empty) if (s.empty)
return false; return false;
return reduce!((a, b) => a && (b == '_' || b == '.' || b == '-' || isAlphaNum(b)))(true, s); return reduce!q{ a && (b == '_' || b == '.' || b == '-' || std.ascii.isAlphaNum(b)) }(true, s);
} }
unittest { unittest {

View File

@ -74,7 +74,7 @@ class Workspace : WorkspaceItem {
} }
@property Setting includePath(){ @property Setting includePath(){
Setting res = _workspaceFile.setting.objectByPath("includePath", true); Setting res = _workspaceFile.objectByPath("includePath", true);
return res; return res;
} }
@ -314,11 +314,11 @@ class Workspace : WorkspaceItem {
if (df && !_description.empty) // cut off last delimiter if (df && !_description.empty) // cut off last delimiter
_description = _description[ 0 .. $ - 3 ]; _description = _description[ 0 .. $ - 3 ];
} }
_workspaceFile.setting.setString("name", toUTF8(_name)); _workspaceFile.setString("name", toUTF8(_name));
_workspaceFile.setting.setString("description", toUTF8(_description)); _workspaceFile.setString("description", toUTF8(_description));
Log.d("workspace name: ", _name); Log.d("workspace name: ", _name);
Log.d("workspace description: ", _description); Log.d("workspace description: ", _description);
Setting projects = _workspaceFile.setting.objectByPath("projects", true); Setting projects = _workspaceFile.objectByPath("projects", true);
projects.clear(SettingType.OBJECT); projects.clear(SettingType.OBJECT);
foreach (Project p; _projects) { foreach (Project p; _projects) {
if (p.isDependency) if (p.isDependency)
@ -346,8 +346,8 @@ class Workspace : WorkspaceItem {
return false; return false;
} }
_settings.load(filename ~ WORKSPACE_SETTINGS_EXTENSION); _settings.load(filename ~ WORKSPACE_SETTINGS_EXTENSION);
_name = toUTF32(_workspaceFile.setting["name"].str); _name = toUTF32(_workspaceFile["name"].str);
_description = toUTF32(_workspaceFile.setting["description"].str); _description = toUTF32(_workspaceFile["description"].str);
Log.d("workspace name: ", _name); Log.d("workspace name: ", _name);
Log.d("workspace description: ", _description); Log.d("workspace description: ", _description);
if (_name.empty()) { if (_name.empty()) {
@ -355,7 +355,7 @@ class Workspace : WorkspaceItem {
return false; return false;
} }
auto originalStartupProjectName = _settings.startupProjectName; auto originalStartupProjectName = _settings.startupProjectName;
Setting projects = _workspaceFile.setting.objectByPath("projects", true); Setting projects = _workspaceFile.objectByPath("projects", true);
foreach(string key, Setting value; projects) { foreach(string key, Setting value; projects) {
string path = value.str; string path = value.str;
Log.d("project: ", key, " path:", path); Log.d("project: ", key, " path:", path);

View File

@ -1 +1 @@
v0.8.17 v0.8.13

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -227,7 +227,6 @@ OPTION_VERBOSE=Verbose
OPTION_WORKING_DIR=Working directory OPTION_WORKING_DIR=Working directory
OPTION_WORKSPACE_NAME=Workspace name OPTION_WORKSPACE_NAME=Workspace name
OPTION_USE_SPACES=Use spaces for tabs OPTION_USE_SPACES=Use spaces for tabs
OPTION_AUTO_AUTOCOMPLETE=Automatically suggest auto completion
ERROR=Error ERROR=Error
ERROR_CANNOT_CREATE_PROJECT=Cannot create project ERROR_CANNOT_CREATE_PROJECT=Cannot create project

View File

@ -221,7 +221,6 @@ OPTION_VERBOSE=Показать подробности
OPTION_WORKING_DIR=Рабочий каталог OPTION_WORKING_DIR=Рабочий каталог
OPTION_WORKSPACE_NAME=Имя рабочего пространства OPTION_WORKSPACE_NAME=Имя рабочего пространства
OPTION_USE_SPACES=Использовать пробелы вместо табуляции OPTION_USE_SPACES=Использовать пробелы вместо табуляции
OPTION_AUTO_AUTOCOMPLETE=Автоматически предлагать дополнение кода
ERROR=Ошибка ERROR=Ошибка
ERROR_CANNOT_CREATE_PROJECT=Не могу создать проект ERROR_CANNOT_CREATE_PROJECT=Не могу создать проект

View File

@ -7,12 +7,6 @@ res/i18n/cs.ini
res/i18n/de.ini res/i18n/de.ini
res/hdpi/hdpi_configure.png res/hdpi/hdpi_configure.png
res/hdpi/hdpi_debug-run.png res/hdpi/hdpi_debug-run.png
res/hdpi/hdpi_debug-pause.png
res/hdpi/hdpi_debug-stop.png
res/hdpi/hdpi_debug-restart.png
res/hdpi/hdpi_debug-step-into.png
res/hdpi/hdpi_debug-step-out.png
res/hdpi/hdpi_debug-step-over.png
res/hdpi/hdpi_document-close.png res/hdpi/hdpi_document-close.png
res/hdpi/hdpi_document-open-recent.png res/hdpi/hdpi_document-open-recent.png
res/hdpi/hdpi_document-open.png res/hdpi/hdpi_document-open.png