@@ -72,11 +72,10 @@ import Language.LSP.Protocol.Types (MarkupContent (MarkupCont
7272 UInt ,
7373 type (|? ) (InL , InR ))
7474
75- data Log = LogDummy
75+ data Log
7676
7777instance Pretty Log where
7878 pretty = \ case
79- LogDummy -> " TODO(@linj) remove this dummy log"
8079
8180descriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
8281descriptor _recorder pluginId =
@@ -88,7 +87,6 @@ signatureHelpProvider :: PluginMethodHandler IdeState Method_TextDocumentSignatu
8887signatureHelpProvider ideState _pluginId (SignatureHelpParams (TextDocumentIdentifier uri) position _mProgreeToken mSignatureHelpContext) = do
8988 nfp <- getNormalizedFilePathE uri
9089 results <- runIdeActionE " signatureHelp.ast" (shakeExtras ideState) $ do
91- -- TODO(@linj) why HAR {hieAst} may have more than one AST?
9290 (HAR {hieAst, hieKind}, positionMapping) <- useWithStaleFastE GetHieAst nfp
9391 case fromCurrentPosition positionMapping position of
9492 Nothing -> pure []
@@ -112,7 +110,6 @@ signatureHelpProvider ideState _pluginId (SignatureHelpParams (TextDocumentIdent
112110 [(_functionName, [] , _argumentNumber)] -> pure $ InR Null
113111 [(functionName, functionTypes, argumentNumber)] ->
114112 pure $ InL $ mkSignatureHelp mSignatureHelpContext docMap argDocMap (fromIntegral argumentNumber - 1 ) functionName functionTypes
115- -- TODO(@linj) what does non-singleton list mean?
116113 _ -> pure $ InR Null
117114
118115mkSignatureHelp :: Maybe SignatureHelpContext -> DocMap -> ArgDocMap -> UInt -> Name -> [Type ] -> SignatureHelp
@@ -250,7 +247,6 @@ nodeHasAnnotation annotation hieAst = case sourceNodeInfo hieAst of
250247 Nothing -> False
251248 Just nodeInfo -> isAnnotationInNodeInfo annotation nodeInfo
252249
253- -- TODO(@linj): the left most node may not be the function node. example: (if True then f else g) x
254250getLeftMostNode :: HieAST a -> HieAST a
255251getLeftMostNode thisNode =
256252 case nodeChildren thisNode of
@@ -275,7 +271,7 @@ getNodeNameAndTypes hieKind hieAst =
275271 in Just (name, filterCoreTypes allTypes)
276272 [] -> Nothing
277273 _ -> Nothing -- seems impossible
278- else Nothing -- TODO(@linj) must function node be HsVar?
274+ else Nothing
279275 where
280276 extractName = rightToMaybe
281277
@@ -291,7 +287,6 @@ getNodeNameAndTypes hieKind hieAst =
291287isUse :: IdentifierDetails a -> Bool
292288isUse = identInfo >>> S. member Use
293289
294- -- TODO(@linj) handle more cases
295290-- Just 1 means the first argument
296291getArgumentNumber :: RealSrcSpan -> HieAST a -> Maybe Integer
297292getArgumentNumber span hieAst
0 commit comments