microsoft / vscode-isort

Import sorting for python using the isort library.
https://marketplace.visualstudio.com/items?itemName=ms-python.isort
MIT License
87 stars 21 forks source link

Cannot read properties of null #18

Closed alexdima closed 2 years ago

alexdima commented 2 years ago

Testing microsoft/vscode-python#18997

I don't think I did anything really, maybe I clicked on the error shown in the editor:

image
ERR Cannot read properties of null (reading 'map'): TypeError: Cannot read properties of null (reading 'map')
    at g (c:\Users\alex\.vscode\extensions\ms-python.isort-2022.1.11161003\dist\extension.js:1:212940)
    at Object.asCodeAction (c:\Users\alex\.vscode\extensions\ms-python.isort-2022.1.11161003\dist\extension.js:1:223880)
    at c:\Users\alex\.vscode\extensions\ms-python.isort-2022.1.11161003\dist\extension.js:1:152614
    at async U.provideCodeActions (c:\Users\alex\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:85:100925)
karthiknadig commented 2 years ago

asCodeAction is called inside LS Client library. I am suspecting we were returning null for code action when we should be returning something. I am hoping that addressing #15 should also address this.