import * as vscode from 'vscode'; let editor = vscode.window.activeTextEditor; let document = editor.document; let text = document.getText(); console.log(text);
import * as vscode from 'vscode'; let editor = vscode.window.activeTextEditor; let document = editor.document; let line = document.lineAt(5); console.log(line.text);This code retrieves the text of the 5th line of the active document in the editor and prints it to the console. Package library: vscode (a library specific to the Visual Studio Code editor).