Sublime Forum

[Solved] Help setting up Linters

#1

Hello Sublime Forum,

I just found SublimeLinter and it seems awesome!

I tried installing some Linters but I just can’t seem to get them to work :frowning:

First Linter is SublimeLinter-contrib-csharplint I have tried following the instructions to the best of my ability, but it still seems to not be working for my C# files :confused:

Next Linter is SublimeLinter-annotations this one seem to work for syntaxes like JS, but again doesn’t work for C# files :confused:

Any help would be greatly appreciated!

Thanks for reading!

0 Likes

#2

I don’t use SublimeLinter-contrib-csharplint, but it looks like it tries to invoke a command called mcs. Can you verify that this command exists in your terminal?

Further research shows that that executable is distributed by the Mono framework. In this issue, another user has problems using this plugin, and the author mentions that it’s indeed targeting the Mono framework. It would be nice if that was clarified in the readme of the plugin.

0 Likes

#4

I just updated Mono and it didn’t seem to fix the issue.
I’m pretty new to all of this, so how would I go about checking if the command “mcs” exists? (I’m on Windows 10 btw)

0 Likes

#5

To see if the plug-in can invoke mcs, open cmd.exe and type “mcs”.

You can also inspect the console of sublime: presss ctrl+` (backtick) for that. Check to see if the plug-in prints any errors there.

0 Likes

#6

I really appreciate all the help :slight_smile:

cmd says that “mcs” doesn’t exist.
And SublimeLinter is giving me the following error:

SublimeLinter: -------------------- 
SublimeLinter: error in SublimeLinter daemon: 
SublimeLinter: -------------------- 
SublimeLinter: Traceback (most recent call last):
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 57, in loop
    item = self.q.get(block=True, timeout=self.MIN_DELAY)
  File "./python3.3/queue.py", line 175, in get
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 65, in loop
    self.lint(view_id, timestamp)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 111, in lint
    self.callback(view_id, timestamp)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\sublimelinter.py", line 120, in lint
    Linter.lint_view(view, filename, code, hit_time, callback)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 929, in lint_view
    linter.lint(hit_time)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 1388, in lint
    cmd = self.get_cmd()
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 1117, in get_cmd
    cmd = self.cmd()
  File "linter in C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-contrib-csharplint.sublime-package", line 90, in cmd
  File "linter in C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-contrib-csharplint.sublime-package", line 121, in get_setting
AttributeError: 'Csharplint' object has no attribute 'get_settings'
 
SublimeLinter: --------------------
0 Likes

#7

Update:

I found out Mono didn’t add itself to my PATH for some reason. “mcs” is now a thing.

I do however get following error from Csharplint:

SublimeLinter: error in SublimeLinter daemon: 
SublimeLinter: -------------------- 
SublimeLinter: Traceback (most recent call last):
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 57, in loop
    item = self.q.get(block=True, timeout=self.MIN_DELAY)
  File "./python3.3/queue.py", line 175, in get
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 65, in loop
    self.lint(view_id, timestamp)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\queue.py", line 111, in lint
    self.callback(view_id, timestamp)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\sublimelinter.py", line 120, in lint
    Linter.lint_view(view, filename, code, hit_time, callback)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 929, in lint_view
    linter.lint(hit_time)
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 1388, in lint
    cmd = self.get_cmd()
  File "C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Packages\SublimeLinter\lint\linter.py", line 1117, in get_cmd
    cmd = self.cmd()
  File "linter in C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-contrib-csharplint.sublime-package", line 90, in cmd
  File "linter in C:\Users\Son_Of_Diablo\AppData\Roaming\Sublime Text 3\Installed Packages\SublimeLinter-contrib-csharplint.sublime-package", line 121, in get_setting
AttributeError: 'Csharplint' object has no attribute 'get_settings'
 
SublimeLinter: --------------------
0 Likes

#8

What that means is that this line here fails. Report that here and hope that the package maintainer responds.

It’s perhaps possible that the base class (Linter) used to have that method, but maybe SublimeLinter changed their API.

1 Like

#9

I will get right on that.

Thank you very much!

Would you happen to have any idea s to why SublimeLinter-Annotations don’t trigger in C# files?

0 Likes

#10

Works for me:

0 Likes

#11

Just figured it out, had to disable Csharplint as it broke the whole thing when I were in a C# file.
Works now :slight_smile:

Once again Thank you so much for all of your help!

3 Likes