crystal-lang-tools/vscode-crystal-lang

After code is corrected and saved, previous error/problem is still persistent

wileycoleman opened this issue · 7 comments

Describe the bug
After correcting code to eliminate an error, and saving the fie, the previous problem and flagging of the problem does not go a way.

To Reproduce
Make a simple type error in any code. For example use "string" instead of String. Save the file and see the proper error message and red underlining appear. Now change the code from "string" to "String". Save the file. The error message and red underlining do not go away. Close VScode and re-open it. The error message and underlining finally go away.

Expected behavior
Once error is corrected and file is saved, the red underlining and error messages should go away.

Piece of Code
see screenshot

Screenshots
Screenshot from 2024-03-28 20-57-44

Desktop (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Crystal version: 1.11.2
  • This plugin version: 0.9.3
  • VS Code version: 1.87.2

Additional context
Add any other context about the problem here.

Can you post the full output of the Crystal output channel?

The output tab is blank.

You need to select "Crystal" from the dropdown at the top right of the panel

[Crystal] extension loaded
[Hover] getting context...
[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Hover] error: undefined
[Hover] getting context...
[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Hover] error: undefined
[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Dependencies] error: In src/epub_reader.cr:1:24

1 | def testing_ext(file : string)
^
Error: unexpected token: "string"

[Problems] (epub_reader) $ /usr/bin/crystal build src/epub_reader.cr --no-debug --no-color --no-codegen --error-trace -f json -o /dev/null
[Problems] Error: [{"file":"/home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr","line":1,"column":24,"size":null,"message":"unexpected token: "string""}]

[Hover] getting context...
[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Dependencies] error: In src/epub_reader.cr:1:24

1 | def testing_ext(file : string)
^
Error: unexpected token: "string"

[Hover] error: undefined
[Problems] (epub_reader) $ /usr/bin/crystal build src/epub_reader.cr --no-debug --no-color --no-codegen --error-trace -f json -o /dev/null
[Problems] Error: [{"file":"/home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr","line":1,"column":24,"size":null,"message":"unexpected token: "string""}]

[Hover] getting context...
[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Dependencies] error: In src/epub_reader.cr:1:24

1 | def testing_ext(file : string)
^
Error: unexpected token: "string"

[Hover] error: undefined
[Problems] (epub_reader) $ /usr/bin/crystal build src/epub_reader.cr --no-debug --no-color --no-codegen --error-trace -f json -o /dev/null
[Problems] Error: [{"file":"/home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr","line":1,"column":24,"size":null,"message":"unexpected token: "string""}]

[Hover] getting context...
[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Dependencies] error: In src/epub_reader.cr:1:24

1 | def testing_ext(file : string)
^
Error: unexpected token: "string"

[Hover] error: undefined
[Problems] (epub_reader) $ /usr/bin/crystal build src/epub_reader.cr --no-debug --no-color --no-codegen --error-trace -f json -o /dev/null
[Problems] Error: [{"file":"/home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr","line":1,"column":24,"size":null,"message":"unexpected token: "string""}]

[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Hover] getting context...
[Dependencies] epub_reader $ /usr/bin/crystal tool dependencies /home/cynthia/projects/crystal/epub_reader/src/epub_reader.cr -f flat --no-color
[Hover] error: undefined

The above is from changing "String" to "string" then back. (saving file in between actions.)

Thank you. In the meantime for things to work you can disable a lot of the features to just use snippets and syntax highlighting. Check this repo's README for more info