Skip to content

Commit

Permalink
fix: use fullRange diagnostic field when filtering diagnostics (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuisi authored Mar 6, 2024
1 parent 21c1ef0 commit 37d2d73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lean4-infoview/src/infoview/info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ConfigContext, EditorContext, LspDiagnosticsContext, ProgressContext }
import { lspDiagToInteractive, MessagesList } from './messages';
import { getInteractiveGoals, getInteractiveTermGoal, InteractiveDiagnostic,
InteractiveGoals, UserWidgetInstance, Widget_getWidgets, RpcSessionAtPos, isRpcError,
RpcErrorCode, getInteractiveDiagnostics, InteractiveTermGoal } from '@leanprover/infoview-api';
RpcErrorCode, getInteractiveDiagnostics, InteractiveTermGoal, LeanDiagnostic } from '@leanprover/infoview-api';
import { PanelWidgetDisplay } from './userWidget'
import { RpcContext, useRpcSessionAtPos } from './rpcSessions';
import { GoalsLocation, Locations, LocationsContext } from './goalLocation';
Expand Down Expand Up @@ -267,7 +267,7 @@ function InfoAux(props: InfoProps) {
// Note: the curly braces are important. https://medium.com/geekculture/react-uncaught-typeerror-destroy-is-not-a-function-192738a6e79b
setLspDiagsHere(diags0 => {
const diagPred = (d: Diagnostic) =>
RangeHelpers.contains(d.range, {line: pos.line, character: pos.character}, config.allErrorsOnLine)
RangeHelpers.contains((d as LeanDiagnostic).fullRange || d.range, {line: pos.line, character: pos.character}, config.allErrorsOnLine)
const newDiags = (lspDiags.get(pos.uri) || []).filter(diagPred)
if (newDiags.length === diags0.length && newDiags.every((d, i) => d === diags0[i])) return diags0
return newDiags
Expand Down
4 changes: 2 additions & 2 deletions vscode-lean4/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37d2d73

Please sign in to comment.