Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit 787dd89

Browse files
committed
feat: remove special handling of LSP EMODENOTFOUND
1 parent d123657 commit 787dd89

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/hoverifier.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343
getTokenAtPosition,
4444
HoveredToken,
4545
} from './token_position'
46-
import { EMODENOTFOUND, HoverMerged, LineOrPositionOrRange, LOADING } from './types'
46+
import { HoverMerged, LineOrPositionOrRange, LOADING } from './types'
4747

4848
export { HoveredToken }
4949

@@ -561,12 +561,7 @@ export function createHoverifier<C extends object>({
561561
? hoverMergedOrNull
562562
: new Error(`Invalid hover response: ${JSON.stringify(hoverMergedOrNull)}`)
563563
),
564-
catchError(error => {
565-
if (error && error.code === EMODENOTFOUND) {
566-
return [null]
567-
}
568-
return [asError(error)]
569-
}),
564+
catchError(error => [asError(error)]),
570565
share()
571566
)
572567
// 1. Reset the hover content, so no old hover content is displayed at the new position while fetching

src/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import { Hover, MarkedString, MarkupContent, Range } from 'vscode-languageserver
22

33
export const LOADING: 'loading' = 'loading'
44

5-
/** LSP proxy error code for unsupported modes */
6-
export const EMODENOTFOUND = -32000
7-
85
/** A hover that is merged from multiple Hover results and normalized. */
96
export type HoverMerged = Pick<Hover, Exclude<keyof Hover, 'contents'>> & {
107
/** Also allows MarkupContent[]. */

0 commit comments

Comments
 (0)