Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class CodeCommenter {

let selectionRange = editor.getSelectionRange();
// selected text by user
let selectedText = editor.getSelectedText();
let selectedText = editor.getCopyText();
// get the lines length
let line_len = selectedText.split(/\r?\n/).length;
// get the comment syntax for the file extension
Expand Down Expand Up @@ -279,7 +279,7 @@ class CodeCommenter {
let modifiedText: string = selectedText.replace(cmt["first"], "");
modifiedText = modifiedText.replace(cmt["last"], "");
// Replace the selected text with the commented text
editor.getSession().replace(selectionRange, modifiedText);
editor.session.replace(selectionRange, modifiedText);
// Reset extension
this.extensions = [];
// Show a success toast message
Expand All @@ -288,7 +288,7 @@ class CodeCommenter {
}
let modifiedText: string = cmt["first"] + selectedText + cmt["last"];
// Replace the selected text with the commented text
editor.getSession().replace(selectionRange, modifiedText);
editor.session.replace(selectionRange, modifiedText);
// Reset extension
this.extensions = [];
// Show a success toast message
Expand All @@ -306,7 +306,7 @@ class CodeCommenter {
let newText: string = modifiedText.join("\n");

// Replace the selected text with the commented text
editor.getSession().replace(selectionRange, newText);
editor.session.replace(selectionRange, newText);
// Reset the extensions
this.extensions = [];
// Show a success toast message
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2016",
"target": "es2019",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
Expand Down