crystal-ameba/vscode-crystal-ameba

Visual Studio Code open ameba issue on a separate window

max-bertinetti opened this issue · 7 comments

For example if I write this simple code:

# TODO: Write documentation for `Web`
module Web
  require "kemal"

  VERSION = "0.1.0"

  get "/" do
    "Hello World!"
  end

  Kemal.run
end

It gives a:

syntax error in 'STDIN:4:3': can't require inside type declarations

on another windows on save only, so you have to undo the save and correct.

Sorry, I didn’t understand what the issue is. There is a syntax error (properly reported by ameba) which needs to be corrected. Does ameba plugin somehow prevent you from editing the file? Some screenshots could be useful

I don't have any issues locally using the latest vscode plugin, crystal and ameba linter:

image

It correctly shows me the error, the file can be edited and saved.

Would be nice to have some screenshot/gif to better understand your issue.

  1. Installed Crystal on Ubuntu (Crystal v0.32.1)
  2. Installed Ameba from source (Ameba v0.11.0)
  3. Created a project i(crystal init app web)
  4. Open in VSCode (I have crystal-ameba and crystal-language extension by F. Aguilar)

If I have format on save option or try to format with CTRL + MAIUSC + I it screw like this:

Schermata del 2019-12-28 08-21-37

I have to undo (CTRL-Z) for see the code again

I cannot format on save or with command.

I try to disable your plugin and the problem went again.
So probably the problem is with @faustinoaq plugin......what are you using for syntax higlight crystal?

I see, thanks.

This plugins doesn’t do syntax highlighting and does not format sources.

@faustinoaq could you please take a look? This is probably related to “Crystal Language” extension.

@veelenga But in your screenshot I see syntax highlighting in crystal file: what are you using?