Skip to content

Migration to text-2.* #2583

Closed
Closed
@pepeiborra

Description

@pepeiborra

There are at least two dependencies that block this migration:

  1. lsp-types: Migration to text 2.0 lsp#391
  2. bytestring-encoding: Support text 2.0 msakai/bytestring-encoding#6

The first one is obviously a hard requirement, but for the second one there's only one call site so we could consider dropping it:

persistentHieFileRule :: Rules ()
persistentHieFileRule = addPersistentRule GetHieAst $ \file -> runMaybeT $ do
res <- readHieFileForSrcFromDisk file
vfs <- asks vfs
encoding <- liftIO getLocaleEncoding
(currentSource,ver) <- liftIO $ do
mvf <- getVirtualFile vfs $ filePathToUri' file
case mvf of
Nothing -> (,Nothing) . T.decode encoding <$> BS.readFile (fromNormalizedFilePath file)
Just vf -> pure (Rope.toText $ _text vf, Just $ _lsp_version vf)
let refmap = Compat.generateReferencesMap . Compat.getAsts . Compat.hie_asts $ res
del = deltaFromDiff (T.decode encoding $ Compat.hie_hs_src res) currentSource
pure (HAR (Compat.hie_module res) (Compat.hie_asts res) refmap mempty (HieFromDisk res),del,ver)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions