Skip to content

Commit

Permalink
fix remaining undefineds
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Feb 11, 2024
1 parent 41a696a commit 4f4eb7a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/swarm-lang/Swarm/Language/LSP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ lspMain =
runServer $
ServerDefinition
{ defaultConfig = ()
, configSection = undefined
, parseConfig = undefined
, configSection = "swarm"
, parseConfig = const $ const $ Right ()
, onConfigChange = const $ return ()
, doInitialize = \env _req -> pure $ Right env
, staticHandlers = const handlers
Expand All @@ -58,8 +58,8 @@ lspMain =
}
where
-- Using SyncFull seems to handle the debounce for us.
-- The alternative is to use SyncIncremental, but then then
-- handler is called for each key-stroke.
-- The alternative is to use SyncIncremental, but then the
-- handler is called for each keystroke.
syncKind = LSP.TextDocumentSyncKind_Full

diagnosticSourcePrefix :: Text
Expand Down Expand Up @@ -113,12 +113,12 @@ validateSwarmCode doc version content = do
makeUnusedVarDiagnostic (range, msg) =
LSP.Diagnostic
range
(Just undefined {- LSP.DsWarning -}) -- severity
(Just LSP.DiagnosticSeverity_Warning) -- severity
Nothing -- code
Nothing -- code description
(Just diagnosticSourcePrefix) -- source
msg
(Just (undefined {- LSP.List -} [undefined {- LSP.DtUnnecessary -}])) -- tags
(Just [LSP.DiagnosticTag_Unnecessary]) -- tags
Nothing -- related source code info
Nothing -- data
makeParseErrorDiagnostic :: ((Int, Int), (Int, Int), Text) -> LSP.Diagnostic
Expand All @@ -128,13 +128,13 @@ validateSwarmCode doc version content = do
(LSP.Position (fromIntegral startLine) (fromIntegral startCol))
(LSP.Position (fromIntegral endLine) (fromIntegral endCol))
)
(Just undefined {- LSP.DsError -}) -- severity
(Just LSP.DiagnosticSeverity_Error) -- severity
Nothing -- code
Nothing -- code description
(Just diagnosticSourcePrefix) -- source
msg
Nothing -- tags
(Just (undefined {- LSP.List -} [])) -- related info
(Just []) -- related info
Nothing -- data

showTypeErrorPos :: Text -> ContextualTypeErr -> ((Int, Int), (Int, Int), Text)
Expand Down

0 comments on commit 4f4eb7a

Please sign in to comment.