Skip to content

Investigate how we load files #3307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andyleejordan opened this issue Apr 27, 2021 · 2 comments
Closed

Investigate how we load files #3307

andyleejordan opened this issue Apr 27, 2021 · 2 comments
Assignees
Labels

Comments

@andyleejordan
Copy link
Member

We should be loading files lazily. That is, not until the file has been opened and the editor focussed. In logs attached to #3289, it appears that we might be recursively parsing every .ps1 file, which would cause a large performance penalty. As a relatively new maintainer I am not sure how we do this, and would like to thoroughly investigate.

@andyleejordan
Copy link
Member Author

For what it's worth, it definitely looks like we examine every .ps1 file because otherwise I don't know how PSES is finding symbols defined in other files 🙃

@andyleejordan
Copy link
Member Author

Closing this. I spent some time in the code lens files and yes, we explicitly load referenced files when resolving the "references" code lens because that is the only way to determine how many references in the workspace are made to each symbol. This is similar to many other projects, and the constraint is that it happens to files in the workspace. For most use cases, this is totally fine and expected, but obviously performance will suffer if someone opens e.g. a top-level src folder as a workspace, indicating to the extension that it should parse every PowerShell file in all their repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant