[Fix]: handle the file open in compile disgnostic provider#237
Draft
[Fix]: handle the file open in compile disgnostic provider#237
Conversation
Collaborator
QianrenLi
commented
Mar 30, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issue #234 by enhancing error handling in the file open process for the compile diagnostic provider and refining the formatting options in the LaTeX document format provider.
- Updated texDocumentFormatProvider.ts to support dynamic print widths based on configuration.
- Wrapped file open in compileManager.ts with try/catch to gracefully handle FileNotFound errors.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/intellisense/texDocumentFormatProvider.ts | Added configuration-based printWidth to the Prettier formatting options. |
| src/compile/compileManager.ts | Wrapped file open logic in try/catch to return false for FileNotFound errors and rethrow others. |
Files not reviewed (2)
- package.json: Language not supported
- package.nls.json: Language not supported
Comments suppressed due to low confidence (1)
src/compile/compileManager.ts:77
- Consider adding tests for the FileNotFound error scenario to ensure that the graceful failure behavior is validated.
if (error instanceof vscode.FileSystemError && error.code === 'FileNotFound') {
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issue #234 by handling file open errors in the compile diagnostic provider and refining the formatting logic for LaTeX documents, along with updating the documentation to reflect the new formatting behavior.
- Improved error handling when opening the log file in the compile manager.
- Added configurable print width in the LaTeX document formatter.
- Updated docs to describe the line break formatting behavior.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/intellisense/texDocumentFormatProvider.ts | Adds a configurable printWidth based on a user setting. |
| src/compile/compileManager.ts | Implements try/catch around file reading with conditional handling for FileNotFound. |
| docs/wiki.md | Updates documentation to explain the new line break formatting feature. |
Files not reviewed (2)
- package.json: Language not supported
- package.nls.json: Language not supported
Comments suppressed due to low confidence (1)
docs/wiki.md:398
- [nitpick] Consider revising the sentence for clarity. For example, 'Formatter: Line break: The formatter restricts line length to 80 characters by default. Toggling the following option disables this feature.'
- **Formatter: Line break**: The formatter will restrict line length as 80 characters in default. Toggle the following option will disable this feature.
6cd7626 to
17e41eb
Compare
17e41eb to
8a9d3e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.