You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The drop down menu does not contain a formatter entry for format-astyle. The problem seems to be you are not registering it as a formatter with vscode.languages.registerDocumentFormattingEditProvider(language, formatter).
Following is an example from the VS Code AStyle extension. It needs to be added to your extension at the appropriate place:
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
function activate(context) {
let formatter = new AstyleFormatter();
let additionalLanguages = vscode.workspace.getConfiguration('astyle')['additional_languages'] || [];
["c", "cpp", "objective-c", "csharp", "java"].concat(additionalLanguages).forEach(function (language) {
let config = vscode.workspace.getConfiguration('astyle')[language];
if (config && !config.enable) {
return;
}
let disposable = vscode.languages.registerDocumentFormattingEditProvider(language, formatter);
context.subscriptions.push(disposable);
});
context.subscriptions.push(formatter);
}
The text was updated successfully, but these errors were encountered:
The drop down menu does not contain a formatter entry for format-astyle. The problem seems to be you are not registering it as a formatter with vscode.languages.registerDocumentFormattingEditProvider(language, formatter).
Following is an example from the VS Code AStyle extension. It needs to be added to your extension at the appropriate place:
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
function activate(context) {
let formatter = new AstyleFormatter();
let additionalLanguages = vscode.workspace.getConfiguration('astyle')['additional_languages'] || [];
}
The text was updated successfully, but these errors were encountered: