Skip to content

Conversation

QianrenLi
Copy link
Collaborator

resolve #234

@iamhyc iamhyc marked this pull request as ready for review March 31, 2025 15:55
@iamhyc iamhyc requested a review from Copilot March 31, 2025 15:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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') {

@iamhyc iamhyc requested a review from Copilot April 1, 2025 13:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@QianrenLi QianrenLi force-pushed the 234-handle-openfile branch from 6cd7626 to 17e41eb Compare April 1, 2025 13:38
@QianrenLi QianrenLi force-pushed the 234-handle-openfile branch from 17e41eb to 8a9d3e2 Compare April 1, 2025 13:43
@QianrenLi QianrenLi marked this pull request as draft April 1, 2025 13:44
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.

Compilation hangs indefinitely with both simple and complex documents
1 participant