Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 98626

How to Access file content in vs code extension

$
0
0

I want to scan through the currently opened file in the workspace. How do I do that?

I tried below lines

console.log(vscode.window.activeTextEditor); //Didn't work

The below code didn't work.

    vscode.workspace.openTextDocument(vscode.window.terminals).then(document => {
        let text = document.getText();
       // console.log(text);
    });

I see and error saying "did not find a valid project structure, exiting...."

P.S: Currently I'm running this on a salesforce project.


Viewing all articles
Browse latest Browse all 98626


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>