Add $PROJECTPATH and ${project_root} as keywords for commands in LSP, Formatter and Linter.

This commit is contained in:
Martín Lucas Golini
2024-06-24 23:31:19 -03:00
parent 9c3e68ee9a
commit e54c7dee4f
3 changed files with 28 additions and 15 deletions

View File

@@ -442,7 +442,11 @@ void FormatterPlugin::runFormatter( UICodeEditor* editor, const Formatter& forma
}
std::string cmd( formatter.command );
String::replaceAll( cmd, "$FILENAME", "\"" + path + "\"" );
std::string pathstr( "\"" + path + "\"" );
String::replaceAll( cmd, "$FILENAME", pathstr );
String::replaceAll( cmd, "${file_path}", pathstr );
String::replaceAll( cmd, "$PROJECTPATH", mPluginManager->getWorkspaceFolder() );
String::replaceAll( cmd, "${project_root}", mPluginManager->getWorkspaceFolder() );
Process process;
if ( process.create( cmd ) ) {
std::string data;