Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
}

const newLine = event.document.lineAt(newLineNumber);
if (newLine.text.trim().length > 0) {
continue;
}
Comment on lines 1100 to +1103

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Dot prefix no longer added when splitting a line

The new guard skips auto‑continuation whenever the target line already contains non‑whitespace characters. This prevents semicolons from being injected during move‑line operations, but it also disables dot prefix propagation for normal editing when a user presses Enter in the middle of a dot‑prefixed statement (the new line initially contains the trailing text, so trim().length is >0). The result is a new line that lacks the required leading dots, leaving the block at the wrong indentation level and forcing the user to fix syntax manually.

Useful? React with 👍 / 👎.

if (newLine.text.startsWith(insertText)) {
continue;
}
Expand Down
16 changes: 16 additions & 0 deletions src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@ suite("Extension Test Suite", () => {
}
});

test("Moving lines across dot-prefixed semicolon comments doesn't add semicolons", async () => {
const document = await vscode.workspace.openTextDocument({
language: "objectscript",
content: " . Do ##class(Test).Run()\n . ; Comment",
});
const editor = await vscode.window.showTextDocument(document);
try {
editor.selection = new vscode.Selection(new vscode.Position(0, 0), new vscode.Position(0, 0));
await vscode.commands.executeCommand("editor.action.moveLinesDownAction");
const expectedText = " . ; Comment\n . Do ##class(Test).Run()";
await waitForCondition(() => document.getText() === expectedText);
assert.strictEqual(document.getText(), expectedText);
} finally {
await vscode.commands.executeCommand("workbench.action.closeActiveEditor");
}
});
test("Go to Definition resolves to sibling workspace folder", async function () {
this.timeout(10000);
await waitForIndexedDocument("MultiRoot.Shared.cls", "shared");
Expand Down