Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs queries don't work #8

Closed
rikvdkleij opened this issue Nov 7, 2020 · 7 comments
Closed

Refs queries don't work #8

rikvdkleij opened this issue Nov 7, 2020 · 7 comments

Comments

@rikvdkleij
Copy link

The name-refs and type-ref commands don't work. They always return an empty result.

The content of the generated database looks okay.

I have tried several times but I don't see what I'm doing wrong. Just try to get it working for a small project.

What I noticed is that the point-info doesn't contain the reference info:

➜  testproject ~/.local/bin/hiedb --database bla.db point-info Main 15 6
Span: app/Main.hs:15:6-8
Constructors: {(HsVar, HsExpr)}
Identifiers:
Symbol:v:fun:Lib:testproject-0.1.0.0-AMJ21WZpd0z2Yf4Se70ef2
fun defined at <no location info>
    IdentifierDetails Just [B, a, r, T, y, p, e,  , -, >,  , S, t, r,
                            i, n, g] {Use}
Types:
BarType -> String
@wz1000
Copy link
Owner

wz1000 commented Nov 7, 2020

Should be fixed in master now, this was a side effect of trying to integrate with ghcide.

@rikvdkleij
Copy link
Author

Thanks for your quick reply! I will give it a try.

@rikvdkleij
Copy link
Author

Yes, that fixes it for both refs command.

The point-info command above is still missing the definition info:

fun defined at <no location info>

@wz1000
Copy link
Owner

wz1000 commented Nov 7, 2020

Yes, names from another component don't have the SrcSpan attached (which is a GHC limitation), so you can't see it via point-info. Use point-defs instead, that will search through the database for the definition.

@wz1000 wz1000 closed this as completed Nov 7, 2020
@rikvdkleij
Copy link
Author

rikvdkleij commented Nov 7, 2020

Sorry for hijacking this issue but using point-defs gives this error:

➜  testproject ~/.local/bin/hiedb --database bla.db point-defs Main 15 6
hiedb: SQLite3 returned ErrorError while attempting to perform prepare "SELECT defs.*, mods.mod,mods.unit,mods.is_boot,mods.hs_src,mods.is_real,mods.time FROM defs JOIN mods USING (hieFile) WHERE occ = :occ AND (:mod IS NULL OR mods = :mod) AND (:unit IS NULL OR unit = :unit)": no such column: mods

@wz1000
Copy link
Owner

wz1000 commented Nov 7, 2020

Ah, thanks for catching this typo. Guess I should really write some tests 😰.

Fixed in 7010bfd

@rikvdkleij
Copy link
Author

Yes, that fixes it!

Your quick response is really appreciated!

Ah, thanks for catching this typo. Guess I should really write some tests 😰.

I know that feeling 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants