Skip to content

feat: error handling for pretty-printer (local and remote); detect duplicate formula names - #5

Merged
jzxia merged 14 commits into
masterfrom
feat__local_pretty_printer__error_handling
Jul 9, 2026
Merged

feat: error handling for pretty-printer (local and remote); detect duplicate formula names#5
jzxia merged 14 commits into
masterfrom
feat__local_pretty_printer__error_handling

Conversation

@jzxia

@jzxiajzxia commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

When the user executes command "TPTP: Format TPTP File", JJParser runs locally to pretty-print the source file. Currently, JJParser's error messages are ignored.

This pull request handles these error messages so that whenever the local JJParser reports an error, it is shown as a toast in VSCode, the cursor is moved to the position of the error (if the error contains the description of a location), and a diagnostic (i.e., a hoverable squiggle) is shown under the problematic token or character. Stale diagnostic is cleared on any edit or new pretty-printer run in the current document.

jzxia added 2 commits July 2, 2026 22:01
… move cursor to position if the error message contains a position
- It takes up too much space in editor that could be used to display
open tabs.
- The command `TPTP: Format Document` will eventually be removed in
favor of `TPTP: Format TPTP File` which calls JJParser locally.
But at present, the former command should be kept as it supports range
formatting (albeit with known bugs) while the latter doesn't.
@jzxia

jzxia commented Jul 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

I'm removing the button for "TPTP: Format Document" because:

  • It takes up too much space in the editor's title bar that could be used to display open tabs.
  • Even if this button is removed, the user can still execute the command from the command palette.
  • The command TPTP: Format Document will eventually be removed in favor of TPTP: Format TPTP File which calls JJParser locally. But at present, the former command should be kept as it supports range formatting (albeit with known bugs) while the latter doesn't.

jzxia added 2 commits July 3, 2026 13:04
…display error message and jump to position of syntax error.
@jzxiajzxia changed the title Feat: error handling for local pretty printerFeat: error handling for pretty-printer (local and remote)Jul 3, 2026
@jzxiajzxia changed the title Feat: error handling for pretty-printer (local and remote)feat: error handling for pretty-printer (local and remote); detect duplicate formula namesJul 9, 2026
@jzxia
jzxia merged commit 12a09a4 into masterJul 9, 2026
2 checks passed
Sign up for freeto 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.

1 participant

@jzxia