@@ -26,6 +26,7 @@ export async function registerClientServerCommands(context: ExtensionContext, la
2626 registerCodeLensReferencesCommands ( context , languageClient ) ;
2727 registerValidationCommands ( context ) ;
2828 registerCodeLensAssociationCommands ( context , languageClient ) ;
29+ registerAssociationCommands ( context , languageClient ) ;
2930
3031 // Register client command to execute custom XML Language Server command
3132 context . subscriptions . push ( commands . registerCommand ( ClientCommandConstants . EXECUTE_WORKSPACE_COMMAND , ( command , ...rest ) => {
@@ -195,3 +196,20 @@ function registerCodeLensAssociationCommands(context: ExtensionContext, language
195196 grammarAssociationCommand ( uriString , languageClient )
196197 } ) ) ;
197198}
199+
200+ /**
201+ * Register commands used for associating grammar file (XSD,DTD) to a given XML file
202+ *
203+ * @param context the extension context
204+ * @param languageClient the language server client
205+ */
206+ function registerAssociationCommands ( context : ExtensionContext , languageClient : LanguageClient ) {
207+ context . subscriptions . push ( commands . registerCommand ( ClientCommandConstants . COMMAND_PALETTE_BINDING_WIZARD , async ( ) => {
208+ // const uriFolder = workspace.workspaceFolders[0].uri.path;
209+ // const uriFile = workspace.workspaceFolders[0].uri.fsPath;
210+ const uriString = window . activeTextEditor . document . fileName ;
211+ // const uriString = uriFolder + uriFile;
212+ // const uriString = workspace.workspaceFile.toString();
213+ grammarAssociationCommand ( uriString , languageClient )
214+ } ) ) ;
215+ }
0 commit comments