-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flycheck reporting strange errors #174
Comments
I've noticed that too. I don't know what causes that, but it's a problem on the server side. I remember doing some hack on the server side to just ignore that error but unfortunately I don't think it's released. |
Could you point me in the direction to where you applied that hack? I could problaby figure something out if I just knew where to look. |
The way I did it was on the server side. I looked at the endpoint for It's pretty ugly as an idea, but extremely practical :) |
Hehe, nice! :D @nosami do you think this could BE a useful hack to have on the server side
|
It would be nice to have a setting to ignore code issues messages. Also they should problaby be shown as warnings, not errors. I made a quick fix for that here: (defun omnisharp--flycheck-error-parser-raw-json
(output checker buffer &optional error-level)
"Takes either a QuickFixResponse or a SyntaxErrorsResponse as a
json string. Returns flycheck errors created based on the locations in
the json."
(let* ((json-result
(omnisharp--json-read-from-string output))
(errors (omnisharp--vector-to-list
;; Support both a SyntaxErrorsResponse and a
;; QuickFixResponse. they are essentially the same,
;; but have the quickfixes (buffer locations) under
;; different property names.
(cdr (or (assoc 'QuickFixes json-result)
(assoc 'Errors json-result))))))
(when (not (equal (length errors) 0))
(mapcar (lambda (it)
(flycheck-error-new
:buffer buffer
:checker checker
:filename (cdr (assoc 'FileName it))
:line (cdr (assoc 'Line it))
:column (cdr (assoc 'Column it))
;; A CodeIssues response has Text instead of Message
:message (cdr (or (assoc 'Message it)
(assoc 'Text it)))
:level (if (equal (cdr (assoc 'LogLevel it)) "Warning")
'warning
'error)))
errors)))) Edit: Too many errors reported was a bug on my end. |
Sorry for not replying to this sooner. You can configure the issues/errors that come back here https://github.com/OmniSharp/omnisharp-server/blob/master/OmniSharp/config.json#L28-L31 |
Thanks! Should I close this and create a new issue in omnisharp-server? |
@kimgronqvist No. Well, you could, but it won't get fixed - omnisharp-server is a dead project and is being replaced with omnisharp-roslyn. I don't have time to work on both. edit: PRs will still be accepted though :) |
In most cases, Flycheck works great for catching errors. I do get some weird errors in a file that is otherwise error free though.
Method calls within a file report "Invocation error: AmbigousMatch".
You can reproduce this by running Flycheck on Program.cs in the omnisharp-server project.
The text was updated successfully, but these errors were encountered: