got intellisense working for the most part...

VScode works withs some issues.
VS2022 fails.
10xEditor works fine.
JetBrains Rider fails due to it not supporting <push/pop>_macro pragmas
This commit is contained in:
Edward R. Gonzalez 2023-08-21 23:02:20 -04:00
parent 7be3617083
commit db6e8b33eb
35 changed files with 55 additions and 52 deletions

View File

@ -10,6 +10,7 @@
"UNICODE",
"_UNICODE",
"GEN_TIME"
// "GEN_DONT_USE_NAMESPACE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
@ -26,6 +27,7 @@
"UNICODE",
"_UNICODE",
"GEN_TIME"
// "GEN_DONT_USE_NAMESPACE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "C:/Users/Ed/scoop/apps/llvm/current/bin/clang++.exe",

View File

@ -4,7 +4,7 @@
// This is a simple file reader that reads the entire file into memory.
// It has an extra option to skip the first few lines for undesired includes.
// This is done so that includes can be kept in dependency and component files so that intellisense works.
Code scan_file( char const* path, bool skip_header_includes = true )
Code scan_file( char const* path, bool skip_initial_directives = true )
{
FileInfo file;
@ -24,7 +24,7 @@ Code scan_file( char const* path, bool skip_header_includes = true )
file_read( & file, str, fsize );
str.get_header().Length = fsize;
if ( skip_header_includes )
if ( skip_initial_directives )
{
#define current (*scanner)
StrC toks[] {

View File

@ -20,18 +20,18 @@ constexpr char const* generation_notice =
"// This file was generated automatially by gen.bootstrap.cpp "
"(See: https://github.com/Ed94/gencpp)\n\n";
constexpr bool DontSkipIncludes = false;
constexpr bool DontSkipInitialDirectives = false;
int gen_main()
{
gen::init();
Code push_ignores = scan_file( "helpers/push_ignores.inline.hpp", DontSkipIncludes );
Code pop_ignores = scan_file( "helpers/pop_ignores.inline.hpp", DontSkipIncludes );
Code push_ignores = scan_file( "helpers/push_ignores.inline.hpp", DontSkipInitialDirectives );
Code pop_ignores = scan_file( "helpers/pop_ignores.inline.hpp", DontSkipInitialDirectives );
// gen_dep.hpp
{
Code header_start = scan_file( "dependencies/header_start.hpp", DontSkipIncludes );
Code header_start = scan_file( "dependencies/header_start.hpp", DontSkipInitialDirectives );
Code macros = scan_file( "dependencies/macros.hpp" );
Code basic_types = scan_file( "dependencies/basic_types.hpp" );
Code debug = scan_file( "dependencies/debug.hpp" );
@ -192,7 +192,7 @@ int gen_main()
// gen_builder.hpp
{
Code builder = scan_file( "auxillary/builder.hpp" );
Code builder = scan_file( "auxillary/builder.hpp", DontSkipInitialDirectives );
Builder
header = Builder::open( "gen/gen.builder.hpp" );
@ -207,7 +207,7 @@ int gen_main()
// gen_builder.cpp
{
Code builder = scan_file( "auxillary/builder.cpp" );
Code builder = scan_file( "auxillary/builder.cpp", DontSkipInitialDirectives );
Builder
src = Builder::open( "gen/gen.builder.cpp" );
@ -222,7 +222,7 @@ int gen_main()
// gen_scanner.hpp
{
Code parsing = scan_file( "dependencies/parsing.hpp" );
Code scanner = scan_file( "auxillary/scanner.hpp" );
Code scanner = scan_file( "auxillary/scanner.hpp", DontSkipInitialDirectives );
Builder
header = Builder::open( "gen/gen.scanner.hpp" );
@ -239,7 +239,7 @@ int gen_main()
// gen_scanner.cpp
{
Code parsing = scan_file( "dependencies/parsing.cpp" );
Code scanner = scan_file( "auxillary/scanner.cpp" );
Code scanner = scan_file( "auxillary/scanner.cpp", DontSkipInitialDirectives );
Builder
src = Builder::open( "gen/gen.scanner.cpp" );

View File

@ -1,5 +1,5 @@
#pragma once
// #include "static_data.cpp"
#include "static_data.cpp"
Code Code::Global;
Code Code::Invalid;

View File

@ -1,8 +1,8 @@
#pragma once
// #include "types.hpp"
// #include "temp/ecode.hpp"
// #include "temp/eoperator.hpp"
// #include "temp/especifier.hpp"
#include "types.hpp"
#include "temp/ecode.hpp"
#include "temp/eoperator.hpp"
#include "temp/especifier.hpp"
struct AST;
struct AST_Body;

View File

@ -1,5 +1,5 @@
#pragma once
// #include "ast.hpp"
#include "ast.hpp"
#pragma region AST Types
/*

View File

@ -1,6 +1,6 @@
#pragma once
// #include "inlines.hpp"
// #include "temp/ast_inlines.hpp"
#include "inlines.hpp"
#include "temp/ast_inlines.hpp"
#pragma region Constants

View File

@ -1,5 +1,5 @@
#pragma once
// #include "interface.hpp"
#include "interface.hpp"
void AST::append( AST* other )
{

View File

@ -1,5 +1,5 @@
#pragma once
// #include "ast.cpp"
#include "ast.cpp"
internal void init_parser();
internal void deinit_parser();

View File

@ -1,5 +1,5 @@
#pragma once
// #include "ast_types.hpp"
#include "ast_types.hpp"
#pragma region Gen Interface

View File

@ -1,6 +1,6 @@
#pragma once
// #include "temp/etoktype.cpp"
// #include "interface.upfront.cpp"
#include "temp/etoktype.cpp"
#include "interface.upfront.cpp"
namespace Parser
{

View File

@ -1,5 +1,5 @@
#pragma once
// #include "interface.parsing.cpp"
#include "interface.parsing.cpp"
sw token_fmt_va( char* buf, uw buf_size, s32 num_tokens, va_list va )
{

View File

@ -1,5 +1,5 @@
#pragma once
// #include "interface.cpp"
#include "interface.cpp"
#pragma region Upfront

View File

@ -1,5 +1,5 @@
#pragma once
// #include "src_start.cpp"
#include "gen.hpp"
#pragma region StaticData

View File

@ -1,5 +1,5 @@
#pragma once
// #include "header_start.hpp"
#include "header_start.hpp"
using LogFailType = sw(*)(char const*, ...);

View File

@ -1,5 +1,5 @@
#pragma once
// #include "macros.hpp"
#include "macros.hpp"
#pragma region Basic Types

View File

@ -1,5 +1,5 @@
#pragma once
// #include "printing.hpp"
#include "printing.hpp"
#pragma region Containers

View File

@ -1,5 +1,4 @@
#pragma once
// #include "src_start.cpp"
#pragma region Debug

View File

@ -1,5 +1,5 @@
#pragma once
// #include "basic_types.hpp"
#include "basic_types.hpp"
#pragma region Debug

View File

@ -1,5 +1,5 @@
#pragma once
// #include "strings.cpp"
#include "strings.cpp"
#pragma region File Handling

View File

@ -1,5 +1,5 @@
#pragma once
// #include "strings.hpp"
#include "strings.hpp"
#pragma region File Handling

View File

@ -1,5 +1,5 @@
#pragma once
// #include "memory.cpp"
#include "memory.cpp"
#pragma region Hashing

View File

@ -1,5 +1,5 @@
#pragma once
// #include "containers.hpp"
#include "containers.hpp"
#pragma region Hashing

View File

@ -1,5 +1,5 @@
#pragma once
// #include "header_start.hpp"
#include "header_start.hpp"
#pragma region Macros

View File

@ -1,5 +1,5 @@
#pragma once
// #include "printing.cpp"
#include "printing.cpp"
#pragma region Memory

View File

@ -1,5 +1,5 @@
#pragma once
// #include "debug.hpp"
#include "debug.hpp"
#pragma region Memory

View File

@ -1,5 +1,5 @@
#pragma once
// #include "string_ops.cpp"
#include "string_ops.cpp"
#pragma region Printing

View File

@ -1,5 +1,5 @@
#pragma once
// #include "string_ops.hpp"
#include "string_ops.hpp"
#pragma region Printing

View File

@ -1,5 +1,5 @@
#pragma once
// #include "debug.cpp"
#include "debug.cpp"
#pragma region String Ops

View File

@ -1,5 +1,5 @@
#pragma once
// #include "memory.hpp"
#include "memory.hpp"
#pragma region String Ops

View File

@ -1,5 +1,5 @@
#pragma once
// #include "hashing.cpp"
#include "hashing.cpp"
#pragma region String

View File

@ -1,5 +1,5 @@
#pragma once
// #include "hashing.hpp"
#include "hashing.hpp"
#pragma region Strings

View File

@ -1,5 +1,5 @@
#pragma once
// #include "filesystem.cpp"
#include "filesystem.cpp"
#pragma region Timing

View File

@ -1,5 +1,5 @@
#pragma once
// #include "filesystem.hpp"
#include "filesystem.hpp"
#pragma region Timing

View File

@ -48,6 +48,8 @@ global bool generate_builder = true;
global bool generate_editor = true;
global bool generate_scanner = true;
constexpr bool DontSkipInitialDirectives = false;
int gen_main()
{
#define project_dir "../project/"
@ -55,7 +57,7 @@ int gen_main()
Code push_ignores = scan_file( project_dir "helpers/push_ignores.inline.hpp" );
Code pop_ignores = scan_file( project_dir "helpers/pop_ignores.inline.hpp" );
Code single_header_start = scan_file( "components/header_start.hpp" );
Code single_header_start = scan_file( "components/header_start.hpp", DontSkipInitialDirectives );
Builder
header = Builder::open( "gen/gen.hpp" );
@ -69,7 +71,7 @@ int gen_main()
if ( generate_gen_dep )
{
Code header_start = scan_file( project_dir "dependencies/header_start.hpp" );
Code header_start = scan_file( project_dir "dependencies/header_start.hpp", DontSkipInitialDirectives );
Code macros = scan_file( project_dir "dependencies/macros.hpp" );
Code basic_types = scan_file( project_dir "dependencies/basic_types.hpp" );
Code debug = scan_file( project_dir "dependencies/debug.hpp" );
@ -148,14 +150,14 @@ int gen_main()
if ( generate_builder )
{
header.print_fmt( "#pragma region Builder\n\n" );
header.print( scan_file( project_dir "auxillary/builder.hpp" ) );
header.print( scan_file( project_dir "auxillary/builder.hpp",DontSkipInitialDirectives ) );
header.print_fmt( "#pragma endregion Builder\n\n" );
}
if ( generate_scanner )
{
header.print_fmt( "#pragma region Scanner\n\n" );
header.print( scan_file( project_dir "auxillary/scanner.hpp" ) );
header.print( scan_file( project_dir "auxillary/scanner.hpp", DontSkipInitialDirectives ) );
header.print_fmt( "#pragma endregion Scanner\n\n" );
}
@ -234,7 +236,7 @@ int gen_main()
if ( generate_builder )
{
header.print_fmt( "#pragma region Builder\n\n" );
header.print( scan_file( project_dir "auxillary/builder.cpp" ) );
header.print( scan_file( project_dir "auxillary/builder.cpp", DontSkipInitialDirectives ) );
header.print_fmt( "#pragma endregion Builder\n\n" );
}
@ -242,7 +244,7 @@ int gen_main()
if ( generate_scanner )
{
header.print_fmt( "#pragma region Scanner\n\n" );
header.print( scan_file( project_dir "auxillary/scanner.cpp" ) );
header.print( scan_file( project_dir "auxillary/scanner.cpp", DontSkipInitialDirectives ) );
header.print_fmt( "#pragma endregion Scanner\n\n" );
}
#endif