firefly-compiler 0.5.74 → 0.5.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly compiler",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.74",
7
+ "version": "0.5.75",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
@@ -95,18 +95,35 @@ export function activate(context: vscode.ExtensionContext) {
95
95
  }
96
96
  }));
97
97
 
98
- const decorationProvider: vscode.FileDecorationProvider = {
98
+ class FireflyDecorationProvider implements vscode.FileDecorationProvider {
99
+ private _onDidChangeFileDecorations = new vscode.EventEmitter<vscode.Uri | vscode.Uri[]>();
100
+ readonly onDidChangeFileDecorations = this._onDidChangeFileDecorations.event;
101
+
99
102
  provideFileDecoration(uri: vscode.Uri): vscode.FileDecoration | undefined {
100
103
  if(fs.existsSync(path.join(uri.fsPath, '.firefly/package.ff'))) {
104
+ const config = vscode.workspace.getConfiguration('firefly');
105
+ const decorationColor = config.get<string>('packageFolderColor', 'charts.blue'); // Default to 'charts.blue'
101
106
  return {
102
- tooltip: 'Firefly package folder',
103
- color: new vscode.ThemeColor('charts.blue'),
107
+ tooltip: 'Contains .firefly folder',
108
+ color: new vscode.ThemeColor(decorationColor),
104
109
  };
105
110
  }
111
+ return undefined;
106
112
  }
107
- };
108
-
113
+
114
+ refresh(uri: vscode.Uri): void {
115
+ this._onDidChangeFileDecorations.fire(uri);
116
+ }
117
+ }
118
+
119
+ const decorationProvider = new FireflyDecorationProvider();
109
120
  context.subscriptions.push(vscode.window.registerFileDecorationProvider(decorationProvider));
121
+
122
+ const watcher = vscode.workspace.createFileSystemWatcher('**/.firefly/package.ff');
123
+ watcher.onDidCreate(uri => decorationProvider.refresh(vscode.Uri.file(path.dirname(path.dirname(uri.fsPath)))));
124
+ watcher.onDidDelete(uri => decorationProvider.refresh(vscode.Uri.file(path.dirname(path.dirname(uri.fsPath)))));
125
+ watcher.onDidChange(uri => decorationProvider.refresh(vscode.Uri.file(path.dirname(path.dirname(uri.fsPath)))));
126
+ context.subscriptions.push(watcher);
110
127
  }
111
128
 
112
129
  export function deactivate(): Thenable<void> | undefined {
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly language support",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.74",
7
+ "version": "0.5.75",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
@@ -128,6 +128,11 @@
128
128
  ],
129
129
  "default": "verbose",
130
130
  "description": "Traces the communication between VS Code and the language server."
131
+ },
132
+ "firefly.packageFolderColor": {
133
+ "type": "string",
134
+ "default": "charts.blue",
135
+ "description": "The color used for Firefly folder decorations."
131
136
  }
132
137
  }
133
138
  },