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; }