mirror of
https://github.com/haskell/ghcide.git
synced 2025-01-07 10:39:40 +03:00
Handle PackageImporting "this"
"this" means that we only look for the module in the current package, so we only look for a file in that case. Fixes https://github.com/digital-asset/ghcide/issues/37.
This commit is contained in:
parent
f66c886217
commit
d859af2102
@ -68,6 +68,12 @@ locateModule
|
||||
-> m (Either [FileDiagnostic] Import)
|
||||
locateModule dflags exts doesExist modName mbPkgName isSource = do
|
||||
case mbPkgName of
|
||||
-- "this" means that we should only look in the current package
|
||||
Just "this" -> do
|
||||
mbFile <- locateModuleFile dflags exts doesExist isSource $ unLoc modName
|
||||
case mbFile of
|
||||
Nothing -> return $ Left $ notFoundErr dflags modName $ LookupNotFound []
|
||||
Just file -> return $ Right $ FileImport file
|
||||
-- if a package name is given we only go look for a package
|
||||
Just _pkgName -> lookupInPackageDB dflags
|
||||
Nothing -> do
|
||||
|
Loading…
Reference in New Issue
Block a user