waldo1001 / crs-al-language-extension

Make working with the (Dynamics NAV / 365) AL Language easier and more efficient.
MIT License
34 stars 43 forks source link

TypeError: Cannot read property 'document' of undefined #163

Closed f4n0 closed 4 years ago

f4n0 commented 4 years ago
TypeError: Cannot read property 'document' of undefined
    at Object.toggleRunObjectFromStatusBar (c:\Users\Dev\.vscode\extensions\waldo.crs-al-language-extension-1.2.1\out\UI\CRSStatusBar.js:7:54)
    at HandleOnOpenTextDocument (c:\Users\Dev\.vscode\extensions\waldo.crs-al-language-extension-1.2.1\out\CRSFunctions.js:156:18)

maybe adding:

    if(!vscode.window.activeTextEditor)
        return;

before let currentfile = vscode.window.activeTextEditor.document.uri;

can solve the issue.

It happens when I open the pages of the extension that are virtual (eg. with git temporal)

waldo1001 commented 4 years ago

I would like to repro this scenario, but I don't understand when it happens.. . Can you elaborate on that?

f4n0 commented 4 years ago

Hi, try this: open the Developers tools of Vscode, then open any virtual page like using the command AZ AL Dev Tools: Show Code Analyzers Rules

now you will see an error in the developer tools' console

waldo1001 commented 4 years ago

I try that - but I don't see the error anywhere.. ?

waldo1001 commented 4 years ago

Sorry - I can't repro this .. please open the issue again if the problem persists, and you have a repro scenario.