Since there's no way to change / open a document with wrap already turned on, (other than the generic command the toggles wrap on the currently selected editor), another way to do it would be to define a 'wrapped' language to mirror each supported language by LeoJS , and, have the extension make sure at startup that the user's settings contain a specific entry for those languages to have editor.wordWrap set to true. (loop for each of LeoJS languages bodyPlain -> bodyPlainWrap, bodyC - > bodyCWrap, etc... )
And upon checking for language when refreshing the states of a body pane, the 'wrap' state will affect the chosen language. (language will now have the 'wrap' state embedded in them)
const config = vscode.workspace.getConfiguration();
const languageWrapSetting = config.inspect('[your-language].editor.wordWrap');
// Check if the user has already set a preference
if (!languageWrapSetting || !languageWrapSetting.globalValue) {
config.update('[your-language]', { 'editor.wordWrap': 'on' }, vscode.ConfigurationTarget.Global);
}
Since there's no way to change / open a document with wrap already turned on, (other than the generic command the toggles wrap on the currently selected editor), another way to do it would be to define a 'wrapped' language to mirror each supported language by LeoJS , and, have the extension make sure at startup that the user's settings contain a specific entry for those languages to have editor.wordWrap set to true. (loop for each of LeoJS languages bodyPlain -> bodyPlainWrap, bodyC - > bodyCWrap, etc... )
And upon checking for language when refreshing the states of a body pane, the 'wrap' state will affect the chosen language. (language will now have the 'wrap' state embedded in them)