elbywan / crystalline

A Language Server Protocol implementation for Crystal. 🔮
MIT License
424 stars 21 forks source link

Can not find classes in Lucky project #67

Open notramo opened 1 year ago

notramo commented 1 year ago

crystalline doesn't work in Lucky projects, becuse it can't find required classes in migrations. The reason can be that the db/ directory is in the project root, not in the src/ folder.

Also, it doesn't work with macro-generated Lucky classes, like MyModel::DeleteOperation.

elbywan commented 1 year ago

crystalline doesn't work in Lucky projects, becuse it can't find required classes in migrations. The reason can be that the db/ directory is in the project root, not in the src/ folder.

The entry point part of the readme should hopefully cover this - creating a custom .crystalline_main.cr file which requires both folders.

Also, it doesn't work with macro-generated Lucky classes, like MyModel::DeleteOperation.

This is also expected, the only support for macros yet is showing the expansion on hover.

notramo commented 1 year ago

This is also expected, the only support for macros yet is showing the expansion on hover.

But if a class inherits from a macro-generated class, then LSP support stops working inside the class e.g. goto definition, or autocompletion doesn't work, even if the goto target class is not macro-generated.

notramo commented 1 year ago

It works to some extent after adding .crystalline_main.cr.