@@ -540,9 +540,14 @@ function proposedApiPrompt(active: boolean, added?: readonly vscode.WorkspaceFol
540540 }
541541}
542542
543- // The URIs of all classes that have been opened. Used when objectscript.openClassContracted is true.
543+ /** The URIs of all classes that have been opened. Used when ` objectscript.openClassContracted` is true */
544544let openedClasses : string [ ] ;
545545
546+ // Disposables for language configurations that can be modifed by settings
547+ let macLangConf : vscode . Disposable ;
548+ let incLangConf : vscode . Disposable ;
549+ let intLangConf : vscode . Disposable ;
550+
546551export async function activate ( context : vscode . ExtensionContext ) : Promise < any > {
547552 if ( ! packageJson . version . includes ( "SNAPSHOT" ) ) {
548553 try {
@@ -737,6 +742,10 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
737742
738743 iscIcon = vscode . Uri . joinPath ( context . extensionUri , "images" , "fileIcon.svg" ) ;
739744
745+ macLangConf = vscode . languages . setLanguageConfiguration ( macLangId , getLanguageConfiguration ( macLangId ) ) ;
746+ incLangConf = vscode . languages . setLanguageConfiguration ( incLangId , getLanguageConfiguration ( incLangId ) ) ;
747+ intLangConf = vscode . languages . setLanguageConfiguration ( intLangId , getLanguageConfiguration ( intLangId ) ) ;
748+
740749 context . subscriptions . push (
741750 reporter ,
742751 panel ,
@@ -971,9 +980,6 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
971980 isReadonly : true ,
972981 } ) ,
973982 vscode . languages . setLanguageConfiguration ( clsLangId , getLanguageConfiguration ( clsLangId ) ) ,
974- vscode . languages . setLanguageConfiguration ( macLangId , getLanguageConfiguration ( macLangId ) ) ,
975- vscode . languages . setLanguageConfiguration ( incLangId , getLanguageConfiguration ( incLangId ) ) ,
976- vscode . languages . setLanguageConfiguration ( intLangId , getLanguageConfiguration ( intLangId ) ) ,
977983 vscode . languages . registerCodeActionsProvider ( documentSelector ( clsLangId , macLangId ) , new CodeActionProvider ( ) ) ,
978984 vscode . languages . registerWorkspaceSymbolProvider ( new WorkspaceSymbolProvider ( ) ) ,
979985 vscode . debug . registerDebugConfigurationProvider ( "objectscript" , new ObjectScriptConfigurationProvider ( ) ) ,
@@ -1149,6 +1155,18 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
11491155 vscode . commands . executeCommand ( "workbench.files.action.refreshFilesExplorer" ) ;
11501156 }
11511157 }
1158+ if ( affectsConfiguration ( "objectscript.commentToken" ) ) {
1159+ // Update the language configuration for "objectscript" and "objectscript-macros"
1160+ macLangConf ?. dispose ( ) ;
1161+ incLangConf ?. dispose ( ) ;
1162+ macLangConf = vscode . languages . setLanguageConfiguration ( macLangId , getLanguageConfiguration ( macLangId ) ) ;
1163+ incLangConf = vscode . languages . setLanguageConfiguration ( incLangId , getLanguageConfiguration ( incLangId ) ) ;
1164+ }
1165+ if ( affectsConfiguration ( "objectscript.intCommentToken" ) ) {
1166+ // Update the language configuration for "objectscript-int"
1167+ intLangConf ?. dispose ( ) ;
1168+ intLangConf = vscode . languages . setLanguageConfiguration ( intLangId , getLanguageConfiguration ( intLangId ) ) ;
1169+ }
11521170 } ) ,
11531171 vscode . window . onDidCloseTerminal ( ( t ) => {
11541172 const terminalIndex = terminals . findIndex ( ( terminal ) => terminal . name == t . name ) ;
@@ -1382,4 +1400,7 @@ export function deactivate(): void {
13821400 if ( terminals ) {
13831401 terminals . forEach ( ( t ) => t . dispose ( ) ) ;
13841402 }
1403+ macLangConf ?. dispose ( ) ;
1404+ incLangConf ?. dispose ( ) ;
1405+ intLangConf ?. dispose ( ) ;
13851406}
0 commit comments