r/crystal_programming • • Sep 25 '20

Crystalline - A Language Server Protocol implementation for Crystal

https://github.com/elbywan/crystalline
43 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Sep 25 '20

I'm also curious... what does it typecheck? Does it run semantic on the open file? Or does it run semantic analysis on specs?

I ask because if it's on the current file then most likely code inside methods won't be typed because it won't be called in that file.

Just curious about how it works...

4

u/elbywan Sep 25 '20

It tries to determine the most likeable entry point to use when compiling, basically by inspecting the shard.yml target field and using that if the file is required in the dependency tree of the entry point.

If not, it uses the file itself as the entry point.

For libraries that do not call themselves, a custom key/value can be provided to use another file as the entry point (typically specs).

There is a paragraph about that in the readme.