ide: Interpret text as errors

git-svn-id: svn://ultimatepp.org/upp/trunk@11191 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-06-22 07:23:40 +00:00
parent 99338804e2
commit 5a72bf7fa7
7 changed files with 27 additions and 5 deletions

View file

@ -43,11 +43,7 @@ void Ide::BeginBuilding(bool sync_files, bool clear_console)
SetIdeState(BUILDING);
console.Kill();
console.ClearError();
error_cache.Clear();
error.Clear();
SyncErrorsMessage();
error_count = 0;
warning_count = 0;
ClearErrorsPane();
if(clear_console)
console.Clear();
build_time = GetTickCount();

View file

@ -328,6 +328,17 @@ bool Ide::FindLineError(int l) {
return false;
}
void Ide::ClearErrorsPane()
{
linking = false;
linking_line.Clear();
error_cache.Clear();
error.Clear();
SyncErrorsMessage();
error_count = 0;
warning_count = 0;
}
void Ide::PutLinking()
{
linking = true;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

@ -937,6 +937,7 @@ public:
void GotoDirDiffLeft(int line, DirDiffDlg *df);
void GotoDirDiffRight(int line, DirDiffDlg *df);
void DoDirDiff();
void AsErrors();
void HelpMenu(Bar& menu);
void About();
@ -1009,6 +1010,7 @@ public:
void CopyFound(bool all);
void FFoundMenu(Bar& bar);
void SelError();
void ClearErrorsPane();
WString FormatErrorLine(const String& text, int& linecy);
WString FormatErrorLineEP(const String& text, const char *ep, int& linecy);

View file

@ -91,6 +91,7 @@ KEY(CALC, "Calculator", K_CTRL_E)
KEY(QTF, "QTF designer", K_ALT_Q)
KEY(XML, "XML view", K_ALT_X)
KEY(JSON, "JSON view", K_ALT_N)
KEY(ASERRORS, "Interpret text as error list", 0)
KEY(ASSIST, "Assist", ' '|K_CTRL)
KEY(ABBR, "Complete abbreviation", K_CTRL_PERIOD)
KEY(GO_TO_LINE, "Go to line..", K_CTRL|K_SHIFT_G)

View file

@ -647,6 +647,7 @@ void Ide::BrowseMenu(Bar& menu)
menu.AddMenu(AK_QTF, IdeCommonImg::Qtf(), THISBACK(Qtf));
menu.AddMenu(!designer, AK_XML, IdeCommonImg::xml(), THISBACK(Xml));
menu.AddMenu(!designer, AK_JSON, IdeCommonImg::json(), THISBACK(Json));
menu.AddMenu(!designer, AK_ASERRORS, IdeImg::errors(), THISBACK(AsErrors));
menu.AddMenu(AK_DIRDIFF, DiffImg::DirDiff(), THISBACK(DoDirDiff));
}
}

View file

@ -508,6 +508,17 @@ void Ide::DoDirDiff()
dlg.SetFocus();
}
void Ide::AsErrors()
{
ClearErrorsPane();
SetBottom(BERRORS);
String s = editor.IsSelection() ? editor.GetSelection() : editor.Get();
StringStream ss(s);
while(!ss.IsEof())
ConsoleLine(ss.GetLine(), true);
SetErrorEditor();
}
void Ide::LaunchAndroidSDKManager(const AndroidSDK& androidSDK)
{
One<Host> host = CreateHost(false);