Added a new option to set files associations in projects.

Introduced a new configuration file for projects in the project file `.ecode/settings.json` file.
Initially it supports files associations the following way:
```json
{
	"files.associations": {
		"glob_pattern": "language_name",
		"functional": "cpp",
		"map": "cpp",
		"**/c++/**": "cpp"
	}
}
```

Format is exactly the same as in vscode, and also, if no `.ecode/settings.json` file exists but does `.vscode/settings.json` file exists, it will fallback to that one.
This is related to the discussion in issue SpartanJ/ecode#585.
This commit is contained in:
Martín Lucas Golini
2025-10-06 00:12:05 -03:00
parent 92bb0c9d75
commit 4edb776d51
5 changed files with 60 additions and 0 deletions

View File

@@ -2108,6 +2108,9 @@ void App::closeFolder() {
mFileSystemModel->setRootPath( "" );
mPluginManager->setWorkspaceFolder( "" );
updateOpenRecentFolderBtn();
SyntaxDefinitionManager::instance()->resetFileAssociations();
if ( mUniversalLocator )
mUniversalLocator->updateFilesTable();
if ( getConfig().ui.welcomeScreen ) {
@@ -3524,6 +3527,8 @@ void App::loadFolder( std::string path, bool forceNewWindow ) {
if ( mProjectBuildManager )
mProjectBuildManager.reset();
SyntaxDefinitionManager::instance()->resetFileAssociations();
mProjectBuildManager =
std::make_unique<ProjectBuildManager>( rpath, mThreadPool, mSidePanel, this );
mConfig.loadProject( rpath, mSplitter, mConfigPath, mProjectDocConfig, this,