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
277 stars 58 forks source link

Error requiring stdlib #74

Closed baelter closed 1 year ago

baelter commented 5 years ago

macOS 10.14.1 (18B75)

crystal env
CRYSTAL_CACHE_DIR="/Users/anders/.cache/crystal"
CRYSTAL_PATH="/usr/local/Cellar/crystal/0.27.0/src:lib"
CRYSTAL_VERSION="0.27.0"
code --version
1.29.1
bc24f98b5f70467bc689abf41cc5550ca637088e
x64
which crystal
/usr/local/bin/crystal
crystal -v
Crystal 0.27.0 (2018-11-04)

LLVM: 6.0.1
Default target: x86_64-apple-macosx

Settings:

    "crystal-lang.compiler": "/usr/local/bin/crystal",
    "crystal-lang.hover": true,
    "crystal-lang.implementations": true,
    "crystal-lang.logLevel": "warn",
    "crystal-lang.problems": "build",

Error:


while requiring "prelude": can't find file 'prelude'

If you're trying to require a shard:
- Did you remember to run `shards install`?
- Did you make sure you're running the compiler in the same directory as your shard.yml?```
faustinoaq commented 5 years ago

@baelter Thank you for report this, I'll try to reproduce it :+1:

Have you tried scry as well? :sweat_smile: See: https://github.com/crystal-lang-tools/scry/ and https://github.com/crystal-lang-tools/vscode-crystal-lang/wiki/Settings#server

baelter commented 5 years ago

No yet. But I will if that is what's getting most developer attention.

faustinoaq commented 5 years ago

Hi @baelter Do you still have this issue? I'm trying to reproduce it :sweat_smile:

pavestru commented 4 years ago

I am having the same issue right now (macOS 10.14.6)

pavestru commented 4 years ago

Also tested scry (followed installation instructions). Having this one line in main.cr

puts "Hello"

scry gave me this error

[Info  - 3:46:34 PM] Scry is looking into your code...
[Error - 3:46:37 PM] An error was found while searching diagnostics
Unexpected char 'U' at 1:1
Unable to get file info: '/Users/pavestru/code/crystal-test/Users/pavestru/.cache/crysta/Users-pavestru-code-crystal-test-Users-pavestru-.cache-crysta-Users-pavestru-code-crystal-test-Users-pavestru-.cache-crysta-Users-pavestru-code-crystal-test-Users-pavestru-.cache-crysta-Users-pavestru-code-crystal-test-Users-pavestru-.cache-crysta-Users-pavestru-code-crystal-test-Users-pavestru-.cache-crysta-Users-pavestru-code-crystal-test-main.cr': File name too long (File::Error)
  from raise<File::Error+>:NoReturn
  from Crystal::System::File::info?<String, Bool>:(Crystal::System::FileInfo | Nil)
  from Dir::mkdir_p<String>:Nil
  from Crystal::CacheDir#directory_for<String>:String
  from Crystal::Compiler#new_program<Array(Crystal::Compiler::Source)>:Crystal::Program
  from Crystal::Compiler#compile<Array(Crystal::Compiler::Source), String>:Crystal::Compiler::Result
  from Crystal::Command#run:(Bool | Crystal::Compiler::Result | Nil)
  from __crystal_main
  from main
Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues
pavestru commented 4 years ago

Related: https://github.com/crystal-lang-tools/scry/issues/173

baelter commented 4 years ago

Fixed by https://github.com/crystal-lang-tools/vscode-crystal-lang/commit/f3667c88203bcc4b79145dc5fc50f1434d47a2a0

JaykeOps commented 4 years ago

I'm having this issue on debian-buster, ubuntu and when using crystal-docker-image.

I can see that the issue is solved by f3667c8, I actually cloned master and built the extension and it works fine.

I'm just wondering why it hasn't been published to the vscode marketplace? ^^

nobodywasishere commented 1 year ago

This fix has been published for some time.