IDE: help for unknown identifier: do not show error about FPC keyword, the following error is enough

git-svn-id: trunk@43889 -
This commit is contained in:
mattias 2014-02-05 10:15:15 +00:00
parent 9b1b6748f1
commit 119dc4be64
2 changed files with 12 additions and 4 deletions

View File

@ -1400,8 +1400,13 @@ function TIDEHelpManager.ShowHelpForSourcePosition(const Filename: string;
Result:=ShowHelpForDirective('',IDEDirectiveHelpPrefix+Keyword,ErrorMsg)
else
Result:=ShowHelpForKeyword('',FPCKeyWordHelpPrefix+Keyword,ErrorMsg);
if Result=shrHelpNotFound then exit;
if Result=shrSuccess then
exit;
if Result in [shrNone,shrDatabaseNotFound,shrContextNotFound,shrHelpNotFound] then
exit(shrHelpNotFound); // not a FPC keyword
// viewer error
HelpManager.ShowError(Result,ErrorMsg);
Result:=shrCancel;
end;
function CollectDeclarations(CodeBuffer: TCodeBuffer;
@ -1471,7 +1476,10 @@ begin
Result:=CollectDeclarations(CodeBuffer,Complete);
if Complete then exit;
debugln(['TIDEHelpManager.ShowHelpForSourcePosition no declaration found, trying keywords ...']);
Result:=CollectKeyWords(CodeBuffer);
if Result in [shrCancel,shrSuccess] then exit;
debugln(['TIDEHelpManager.ShowHelpForSourcePosition END']);
end;
function TIDEHelpManager.ConvertCodePosToPascalHelpContext(

View File

@ -43,8 +43,8 @@ type
shrSuccess,
shrCancel,
shrDatabaseNotFound,
shrContextNotFound,
shrViewerNotFound,
shrContextNotFound, // database found, but the element was not found
shrViewerNotFound, // no viewer registered for this format
shrHelpNotFound,
shrViewerError,
shrSelectorError
@ -250,7 +250,7 @@ function ShowHelpForContext(HelpDatabaseID: THelpDatabaseID;
function ShowHelpForContext(HelpContext: THelpContext; var ErrMsg: string
): TShowHelpResult; overload;
// help by keyword (an arbitrary keyword, not a fpc keyword)
// help by keyword (an arbitrary keyword, not only fpc keyword)
function ShowHelpOrErrorForKeyword(HelpDatabaseID: THelpDatabaseID;
const HelpKeyword: string): TShowHelpResult;
function ShowHelpForKeyword(HelpDatabaseID: THelpDatabaseID;