From 9c7db374ab875e1ecf6073a4553143a05e7f4774 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Mon, 26 Jun 2023 21:25:25 +0530 Subject: [PATCH] chore: replace deprecated substr method with slice --- completions-sample/src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions-sample/src/extension.ts b/completions-sample/src/extension.ts index 1f473099..54027d75 100644 --- a/completions-sample/src/extension.ts +++ b/completions-sample/src/extension.ts @@ -55,7 +55,7 @@ export function activate(context: vscode.ExtensionContext) { // get all text until the `position` and check if it reads `console.` // and if so then complete if `log`, `warn`, and `error` - const linePrefix = document.lineAt(position).text.substr(0, position.character); + const linePrefix = document.lineAt(position).text.slice(0, position.character); if (!linePrefix.endsWith('console.')) { return undefined; }