-
Notifications
You must be signed in to change notification settings - Fork 285
Standard should use the --no-fix argument when linting #447
Comments
Dup of #435 |
Ahh sorry I found that issue but the top didn't match. Didn't see the additional things at the bottom. Is there a workaround in the meantime? If I disable the language server, I don't get any linting/autoformatting at all. |
Ya, I updated the issue title to include Standard as well. Long story short is that the node spawn is chunking the The workaround is to reduce the linter output so that it fits within one chunk. If you fix some of the problems in the file you should start getting linter results back. I realize this is not great but it's the best I've got right now. This is my top bug I'm looking at. |
@wingrunr21 Now that #435 is merged, it seems like this is still an issue and an unrelated root cause. As you can see from my console output above, it seems that the actual code that is being linted is getting apppended to the JSON payload, which is resulting in invalid json. Have confirmed by logging
|
What version of standard? Also, if you run that exact command in a terminal do you still see the ruby code? I'm not doing any kind of code appending. |
I'm using the latest 0.0.36. Interestingly enough it's hanging when I run the same command in my terminal:
If I modify your extension to instead run |
|
Oh, just realizing |
So I do not get that behavior. Do you have any additional configuration set up for standard? |
Ok, after trying to isolate it to create an issue with standard, I've figured out the problem. My project keeps the Standard configuration using a
Seems that the language server can either split on the |
Well, the This would end up being an unconfigurable override to the config file. What are your thoughts on that? |
Yeah, splitting the output would be useful if you were able to apply the autofixed code back to the buffer, but otherwise wouldn't be helpful and the no-fix would be correct. My understanding is that we already don't get autofixes applied unless we run the formatter on save, so we're no worse off here, correct? |
I could split the output (as that's how the formatter works) but there's no way to push that back to the editor. Linter diagnostics are pushed from the server to the client but text edit requests are round trip originating from the client. It'd also be a little weird since linting happens on text change by default. The whole document could be shifting under your cursor. Well, you can turn on format on save in the editor. That'd achieve the same purpose. I haven't implemented format as you type yet because rubocop/standard/etc are too slow. Sounds like applying |
Thanks! Any way you can cut a new release soon? |
The next release will be a minor version due to a |
ah no worries then, take your time! |
Your environment
vscode-ruby
version: 0.22.2Expected behavior
When using vscode-ruby with standard rb and the following extension settings:
I would expect updates to the file to run and show linter errors if present.
Actual behavior
When running against files in this project (I haven't verified with all of them, but any I've tried), the Ruby Language Server sends the following output when opening or changing a file. The below example is specifically for this file.
The text was updated successfully, but these errors were encountered: