Skip to content

Commit

Permalink
Correctly handle name differences between HighlightSeverity and `Pr…
Browse files Browse the repository at this point in the history
…oblemHighlightType`
  • Loading branch information
InSyncWithFoo committed May 16, 2024
1 parent e9dea47 commit cdd51d8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ For code changes, see [`CHANGELOG_CODE.md`][_-1].

## [Unreleased]

<i>This section is currently empty.</i>
### Fixed

* v0.3.0 has a bug causing an internal error
if the inspections' levels are set as "Weak warnings".
This has been fixed.


## [0.3.0] - 2024-05-13
Expand Down Expand Up @@ -43,8 +47,9 @@ For code changes, see [`CHANGELOG_CODE.md`][_-1].

### Changed

* Default highlight severity levels are now "Error", "Warning" and "Weak warning"
instead of "Warning", "Weak warning" and "Weak warning".
* Default highlight severity levels are now
"Error", "Warning" and "Weak warning" instead of
"Warning", "Weak warning" and "Weak warning".
A future release will allow configuring these levels.
* v0.1.0-mvp.5 has a bug causing the configurations to be always unresetable.
This has been fixed.
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG_CODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ For user-facing changes, see [`CHANGELOG.md`][_-1].

## [Unreleased]

<i>This section is currently empty.</i>
### Fixed

* `HighlightSeverity` member names contain spaces but not underscores,
which causes [`ProblemHighlightType.valueOf()`][31-1] to throw.
A workaround is introduced by manually replacing `" "` with `"_"`. (HEAD)


[31-1]: https://github.com/InSyncWithFoo/pyright-for-pycharm/blob/HEAD/src/main/kotlin/com/insyncwithfoo/pyright/PyrightExternalAnnotator.kt


## [0.3.0] - 2024-05-13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private fun FileDocumentManager.saveAllUnsavedDocumentsAsIs() {


private fun HighlightSeverity.toProblemHighlightType() =
ProblemHighlightType.valueOf(this.name)
ProblemHighlightType.valueOf(this.name.replace(" ", "_"))


private fun InspectionManager.createProblemDescriptor(
Expand Down

0 comments on commit cdd51d8

Please sign in to comment.