crystal-lang-tools / vscode-crystal-lang

Yet another VSCode extension for Crystal Programming Language
https://marketplace.visualstudio.com/items?itemName=crystal-lang-tools.crystal-lang
MIT License
279 stars 58 forks source link

undefined constant Lucky::Env #91

Closed dkniffin closed 3 years ago

dkniffin commented 5 years ago

I just started with Crystal (coming from Ruby) and spun up a new Lucky app. I don't think I've changed anything yet. But when I open my database.cr file, I'm getting this error reported in VSCode:

undefined constant Lucky::Env

I think this is just showing up in VSCode, because when I start the project up, it runs fine. That said, I'm not 100% sure if this is the right project to report this issue for. Let me know if I need to open an issue somewhere else.

faustinoaq commented 5 years ago

Hi @dkniffin, Thank you for open this issue!

Yeah, this error is shown because vscode-crystal-lang can't figure out the scope of this file.

I'm working in a new version of this extension, so I can fix these kind of issues :sweat_smile:

BTW, for now, you can try to set crystal-lang.problems: "syntax" in your settings.json file, see: https://github.com/crystal-lang-tools/vscode-crystal-lang/wiki/Settings#problems

Also, you can still get "build" linting by analyzing crystal output using a VScode Task with a problem matcher, please see: https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher

max-bertinetti commented 4 years ago

@dkniffin have you tried the last vesion of the plugin?

dkniffin commented 4 years ago

@maxbertinetti Nope. I haven't worked with Crystal in a long time :/