This repository was archived by the owner on Dec 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -1066,7 +1066,7 @@ const getActivePythonFile = () => {
1066
1066
} ;
1067
1067
1068
1068
const updateCurrentFileFromEditor = async (
1069
- activeTextDocument : vscode . TextEditor | undefined ,
1069
+ activeTextDocument : Partial < vscode . TextEditor > | undefined ,
1070
1070
currentPanel : vscode . WebviewPanel
1071
1071
) => {
1072
1072
if (
@@ -1097,20 +1097,12 @@ const updateCurrentFileIfPython = async (
1097
1097
activeTextDocument : vscode . TextDocument | undefined ,
1098
1098
currentPanel : vscode . WebviewPanel
1099
1099
) => {
1100
- if ( activeTextDocument && activeTextDocument . languageId === "python" ) {
1101
- setPathAndSendMessage ( currentPanel , activeTextDocument . fileName ) ;
1102
- currentTextDocument = activeTextDocument ;
1103
- } else if ( currentFileAbsPath === "" ) {
1104
- setPathAndSendMessage ( currentPanel , getActivePythonFile ( ) || "" ) ;
1105
- }
1106
- if (
1107
- currentTextDocument &&
1108
- utils . getActiveEditorFromPath ( currentTextDocument . fileName ) ===
1109
- undefined
1110
- ) {
1111
- await vscode . window . showTextDocument (
1112
- currentTextDocument ,
1113
- vscode . ViewColumn . One
1100
+ if ( activeTextDocument ) {
1101
+ await updateCurrentFileFromEditor (
1102
+ {
1103
+ document : activeTextDocument ,
1104
+ } ,
1105
+ currentPanel
1114
1106
) ;
1115
1107
}
1116
1108
} ;
You can’t perform that action at this time.
0 commit comments