I am currently building automation of a vs code extension and the extension basically works on hover action (registerHoverProvider method). Since this method only works when the file that you are hovering on is open inside the editor, I cannot make use of it. For me, the use case is to work on a file that is currently not open inside the editor and pass it along. Any suggestions on how I can do that?
Current code:
vscode.languages.registerHoverProvider([{ scheme: 'file', language: 'typescript' }, { scheme: 'file', language: 'javascript' }], {
provideHover: async (document, position) => {
// Some code here
}
On the above code, I want to change this in such a way that the function works on the document and position parameters without the registerHoverProvider method. I can give the file path as an input and that should be the document/file to be read.
By default, VSCode opens files in preview mode. This is indicated by their name being italic in the menu bar. As John noted, you can double click on the file to fully open it.
To disable this behavior, try setting:
"workbench.editor.enablePreview": false
also Ctrl+P -- For targetting a file Alt+Enter -- For Opening that file into next tab