mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
chore: replace deprecated substr method with slice
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user