AtomLinter / linter-clang

Lint C-based files using Clang.
55 stars 29 forks source link

Not working #258

Open TheShark27 opened 5 years ago

TheShark27 commented 5 years ago

I installed this, along with Linter clang and Linter UI, but no sign of life, except for the blank error page on the bottom. How do I get this to work? I'm totally new to Atom.

Arcanemagus commented 5 years ago

If you open up a file you are expecting an error message on and run Linter: Debug from the Command Palette, what information are you given?

Max-Hollywood commented 5 years ago

@Arcanemagus , I've been using Atom for ages now, and I had no idea what a Command Palette (CTRL SHIFT P) was until I just Googled it. @TheShark27 is "totally new to Atom". I also am having trouble getting any C++ linting/clang-ing working. I got an error saying clang failed to spawn, so I did sudo apt-get install clang, and made sure that all of linter's dependencies were installed when it asked for them.

my output from linter:debug is

Platform: linux
Atom Version: 1.35.1
Linter Version: 2.3.0
Opened file is ignored: No
Matching Linter Providers: 
Disabled Linter Providers: 
Standard Linter Providers: 
Indie Linter Providers: 
 - GCC (after installing linter-gcc by tvincent056)
UI Providers: 
  - Linter
Ignore Glob: **/*.min.{js,css}
VCS Ignored Paths are excluded: true
Current File Scopes: 
  - *
  - source.cpp
  - punctuation.section.parens.end.bracket.round

Solution: On further investigation (this is the second night I've spent doing this):

I could run lint by going into the command palette and doing "linter lint". After a moment the "on the fly" option started working.

EDIT: after crashing Atom with a file too large... I restarted, and using the command palette linter didn't work, and said nothing was there. So I opened the preferences and had a look at the linter settings, and went back to the file and lint returned - so I think it just takes a short time for it to "start" after atom starts, or after the file is opened.

Hope this helps.

EDIT # 2.5: I was curious as to why sometimes it didn't "lint". Turns out, either linter or linter-gcc2 doesn't check inside #ifdef #endifs. My assignment I just submitted was all about conditional compilation, so most of the cpp files are inside #ifdefs, so it didn't lint at all.

Arcanemagus commented 5 years ago
Matching Linter Providers: 
Disabled Linter Providers: 
Standard Linter Providers: 
Indie Linter Providers: 
 - GCC (after installing linter-gcc by tvincent056)

This is saying that either you don't have linter-clang installed when you ran that, or you have the package disabled.

linter-gcc by hebaishi doesn't work linter-gcc2 by tvincent056 seems to work

This is a known issue with linter-gcc, which is why it was forked to linter-gcc2.

atom-clang by joeroback won't even install

This repo has been archived so I'm not surprised it's broken.

I could run lint by going into the command palette and doing "linter lint". After a moment the "on the fly" option started working.

I was curious as to why sometimes it didn't "lint". Turns out, either linter or linter-gcc2 doesn't check inside #ifdef #endifs. My assignment I just submitted was all about conditional compilation, so most of the cpp files are inside #ifdefs, so it didn't lint at all.

It sounds like the scope ("language") of the code was changed inside those #ifdef blocks to something not recognised.

TheShark27 commented 5 years ago

Linter: Debug

Just like @Arcanemagus us I didn't know what command palette was, but here's the information it gave me:

Platform: win32
Atom Version: 1.35.1
Linter Version: 2.3.0
Opened file is ignored: No
Matching Linter Providers: 
Disabled Linter Providers: 
Standard Linter Providers: 
Indie Linter Providers: 
UI Providers: 
  - Linter
Ignore Glob: **/*.min.{js,css}
VCS Ignored Paths are excluded: true
Current File Scopes: 
  - *
  - source.cpp

Sorry for the late response.

TheShark27 commented 5 years ago

Hey @Arcanemagus, thanks a lot! linter-gcc2 by tvincent056 works indeed, I'll be using it if we can't find a solution.

Max-Hollywood commented 5 years ago

Um, you're welcome? :)

TheShark27 commented 3 years ago

Um, you're welcome? :)

@Max-Hollywood Whoops, I tagged the wrong person and never came back here. Here I am two years later. Lol, thanks for your help with whatever this was about :)