Skip to content
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

Added error handling for very large source files. This situation is n… #1973

Merged
merged 2 commits into from
Jun 10, 2021

Conversation

erictraut
Copy link
Collaborator

…ow detected earlier so we don't attempt to load the file contents and crash the language server in the process.

…ow detected earlier so we don't attempt to load the file contents and crash the language server in the process.
@@ -520,6 +524,15 @@ export class SourceFile {
let fileContents = this.getFileContents();
if (fileContents === undefined) {
try {
const fileStat = this.fileSystem.statSync(this._filePath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this section down into the timeOperation below? That way, we'll count the time it takes to stat in addition to the read itself and not have unaccounted time.

@erictraut erictraut merged commit afca267 into main Jun 10, 2021
@erictraut erictraut deleted the erictr/really_big_file branch June 10, 2021 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants