Skip to content

Commit

Permalink
Merge pull request #28285 from brandonlangley/moose_server_format_inc…
Browse files Browse the repository at this point in the history
…ludes_22766

Update MooseServer formatting to not remove include directives
  • Loading branch information
dschwen authored Aug 8, 2024
2 parents 60ae8c4 + a12bafc commit 55dca4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion framework/src/base/MooseServer.C
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,14 @@ MooseServer::gatherDocumentFormattingTextEdits(wasp::DataArray & formattingTextE
int tab_size,
bool /* insert_spaces */)
{
// strip scheme prefix from document uri if it exists for parse file path
std::string parse_file_path = document_path;
pcrecpp::RE("(.*://)(.*)").Replace("\\2", &parse_file_path);

// input check expanded any brace expressions in cached tree so reprocess
std::stringstream input_errors, input_stream(document_text);
wasp::DefaultHITInterpreter interpreter(input_errors);
interpreter.parse(input_stream);
interpreter.parseStream(input_stream, parse_file_path);

// return without adding any formatting text edits if parser root is null
if (interpreter.root().is_null())
Expand Down

0 comments on commit 55dca4d

Please sign in to comment.