Skip to content

Commit f9406ad

Browse files
committed
Only send the code after prepend
1 parent 90c74bc commit f9406ad

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/commands/showPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export async function showPanel(
166166
if (e.uri.toString() === activeEditor?.uri) {
167167
const message = Messages.AssessmentAnswer(
168168
activeEditor.questionId,
169-
activeEditor.code ? activeEditor.code.split("\n").slice(activeEditor.num_prepend_lines).join("\n") : ""
169+
activeEditor.getActualCode()
170170
);
171171

172172
sendToFrontend(panel, message);

src/utils/editor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export class Editor {
3939
return this.editor?.document.getText();
4040
}
4141

42+
getActualCode(): string {
43+
return this.code ? this.code.split("\n").slice(this.num_prepend_lines).join("\n") : ""
44+
}
45+
4246
// TODO: This method is too loaded, it's not obvious it also shows the editor
4347
static async create(
4448
workspaceLocation: VscWorkspaceLocation,

0 commit comments

Comments
 (0)