1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-17 15:46:05 +02:00

Add BfParser_GetLineCharAtIdx, include fields in document symbols and optionally include location in type defs

This commit is contained in:
MineGame159 2022-08-23 19:13:15 +02:00
parent 9daae6baa6
commit 852d11c6c3
5 changed files with 282 additions and 211 deletions

View file

@ -124,10 +124,10 @@ namespace IDE.Compiler
static extern char8* BfCompiler_GetGeneratorGenData(void* bfCompiler, char8* typeDefName, char8* args);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetTypeDefList(void* bfCompiler);
static extern char8* BfCompiler_GetTypeDefList(void* bfCompiler, bool includeLocation);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetTypeDefMatches(void* bfCompiler, char8* searchStr);
static extern char8* BfCompiler_GetTypeDefMatches(void* bfCompiler, char8* searchStr, bool includeLocation);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetTypeDefInfo(void* bfCompiler, char8* typeDefName);
@ -846,14 +846,14 @@ namespace IDE.Compiler
outStr.Append(BfCompiler_GetGeneratorGenData(mNativeBfCompiler, typeDefName, args));
}
public void GetTypeDefList(String outStr)
public void GetTypeDefList(String outStr, bool includeLocation = false)
{
outStr.Append(BfCompiler_GetTypeDefList(mNativeBfCompiler));
outStr.Append(BfCompiler_GetTypeDefList(mNativeBfCompiler, includeLocation));
}
public void GetTypeDefMatches(String searchStr, String outStr)
public void GetTypeDefMatches(String searchStr, String outStr, bool includeLocation = false)
{
outStr.Append(BfCompiler_GetTypeDefMatches(mNativeBfCompiler, searchStr));
outStr.Append(BfCompiler_GetTypeDefMatches(mNativeBfCompiler, searchStr, includeLocation));
}
public void GetTypeDefInfo(String typeDefName, String outStr)

View file

@ -175,6 +175,9 @@ namespace IDE.Compiler
[CallingConvention(.Stdcall), CLink]
static extern void BfParser_SetCompleteParse(void* bfParser);
[CallingConvention(.Stdcall), CLink]
static extern void BfParser_GetLineCharAtIdx(void* bfParser, int32 idx, int32* line, int32* lineChar);
public BfSystem mSystem;
public void* mNativeBfParser;
public bool mIsUsed;
@ -419,5 +422,14 @@ namespace IDE.Compiler
var md5Hash;
BfParser_SetHashMD5(mNativeBfParser, ref md5Hash);
}
public (int, int) GetLineCharAtIdx(int idx) {
int32 line = 0;
int32 char = 0;
BfParser_GetLineCharAtIdx(mNativeBfParser, (.) idx, &line, &char);
return (line, char);
}
}
}