File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,18 @@ export async function activate(context: vscode.ExtensionContext) {
187
187
)
188
188
return ;
189
189
190
+ if ( e . fileName . endsWith ( ".bolt" ) && e . languageId !== "mcfunction" ) {
191
+ vscode . window
192
+ . showWarningMessage (
193
+ ".bolt files aren't associated with mcfunction, this might break highlighting." ,
194
+ "Configure Language Mode"
195
+ )
196
+ . then ( ( s ) => {
197
+ if ( s == "Configure Language Mode" )
198
+ updateFileAssociation ( ) ;
199
+ } ) ;
200
+ }
201
+
190
202
if ( ! client && ! didClientFail ) {
191
203
await startLangServer ( context ) ;
192
204
}
@@ -332,6 +344,15 @@ async function checkEnviroment(pythonCommand: string[]): Promise<boolean> {
332
344
return true ;
333
345
}
334
346
347
+ function updateFileAssociation ( ) {
348
+ const config = vscode . workspace . getConfiguration ( ) ;
349
+ const associations : Record < string , string > =
350
+ config . get ( "files.associations" ) ;
351
+
352
+ associations [ "*.bolt" ] = "mcfunction" ;
353
+ config . update ( "files.associations" , associations ) ;
354
+ }
355
+
335
356
async function runPythonCommand (
336
357
pythonCommand : string ,
337
358
args : string [ ]
You can’t perform that action at this time.
0 commit comments