Skip to content

Commit 557521c

Browse files
authored
Fix uncaught errors (#937)
1 parent ad85c33 commit 557521c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/extension.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,15 +1013,12 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
10131013
)
10141014
),
10151015
vscode.window.onDidChangeActiveTextEditor((editor: vscode.TextEditor) => {
1016-
const uri: string = editor.document.uri.toString();
1017-
if (
1018-
config("openClassContracted") &&
1019-
editor &&
1020-
editor.document.languageId === "objectscript-class" &&
1021-
!openedClasses.includes(uri)
1022-
) {
1023-
vscode.commands.executeCommand("editor.foldLevel1");
1024-
openedClasses.push(uri);
1016+
if (config("openClassContracted") && editor && editor.document.languageId === "objectscript-class") {
1017+
const uri: string = editor.document.uri.toString();
1018+
if (!openedClasses.includes(uri)) {
1019+
vscode.commands.executeCommand("editor.foldLevel1");
1020+
openedClasses.push(uri);
1021+
}
10251022
}
10261023
}),
10271024
vscode.workspace.onDidCloseTextDocument((doc: vscode.TextDocument) => {

0 commit comments

Comments
 (0)