-
Notifications
You must be signed in to change notification settings - Fork 646
Feedback as you type #883
Comments
Hey @tylerb , Answers to your 3 specific questions are Yes, Yes, and Yes. :) Before we dive into this feature, I have a few questions first though
|
Hey @ramya-rao-a! So golint is great and I love using it. However, it doesn't report the kinds of errors I'm wanting to see as I code. For example, if you create a go file containing this:
From the
Seeing these kinds of errors as you type is very useful, as in the example above, where you can catch a simple typo immediately. As for the I hope this clears up my motivation here. Thanks for the response! Let me know what you think. |
FYI, gometalinter uses gotype by default (among other linters) so it's actually already supported. And I believe that you can also use "go.lintTool": "gotype" and it would work just as well. Personally I found gotype riddled with bugs so stopped using it. |
I don't think that Having |
Agreed. It is not necessarily a linter. I suppose a more succinct restatement of what I am trying to do is have live feedback of any errors that I may get when I go to compile, so I can fix those errors before compiling or running tests, etc. I've found it to be very helpful when using sublime. And it should definitely be configurable as to whether it runs or not. Perhaps this is a new concept, something that lives, optionally, along the lint-on-save concept that currently exists. |
I'm with Francesc on this one, I wouldn't want that feature ON by default either and I would strongly suggest to add latency before triggering |
Agreeing with what @campoy says about the gotype. What's so bad about linting on save? It is not necessary a lot of effort to press (cmd+s/control+s) once a while if you need early feedback. An editor that lints my code as I live code is nothing but noise to me. |
I spent a bit of time this morning getting a dev environment set up for Here's a quick gif to see what it looks like. Currently the debounce is set at 200ms, but would definitely be configurable were this to be accepted as a feature. The code is rough and would require a good deal of cleanup before I could submit a PR, but so far I am very much enjoying how it behaves. |
Coming from IntelliJ IDE, this is something I would really enjoy as well. |
Definitely not against, as long as it's not on by default
…On Fri, Mar 31, 2017 at 10:00 AM Robert Kopaczewski < ***@***.***> wrote:
Coming from IntelliJ IDE, this is something I would really enjoy as well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#883 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACIkDEWGvnB6-o4IPqI06ihRAg10C2oJks5rrTEsgaJpZM4MnWAO>
.
|
This is out in the latest update (0.6.59) |
Hi @ramya-rao-a I'm new to vscode and this extension so pardon me if I ask stupid question. But this "lintOnType" option seems to be no where to be found, would you mind assisting on this? Thank you! |
@stanleynguyen Welcome to VS Code :) Add this to your settings:
|
@ramya-rao-a Thanks for your prompt reply. I have added this previously, but it only tells me about syntax errors in the code, not code style problems (i.e. not commenting on top of exported functions), that's what I'm looking for :) |
@stamblerre We dont have lint on type feature. This current issue was to track showing of syntax errors and so I assumed that's what you were referring to Linting errors show up once you save your changes as long as the setting |
One of the things I miss about Sublime Text is the linter setup I had. I created a sublime linter package that called
gotype
to display errors, then changedgotype
to accept the contents of a file via stdin, so the in-memory edited file could be used when linting. This allowedgotype
to provide as-you-type feedback.To enable this functionality, you simply call
gotype
exactly as you would before, but add-lf <path/to/file.go>
and send the contents of that file via stdin.I would love to have this functionality in
vscode-go
, so I am opening an issue here to get some discussion going around it. I'm happy to do the work myself, but I am not sure where to start.The questions that would need to be answered in order for this to work are:
If these things are possible, then we should be able to integrate this lint-as-you-type functionality.
I suppose it would be best to also ask: would anyone else even be interested in this functionality? I find it extremely useful to get feedback as I type to catch all sorts of simple mistakes. I am able to code more quickly this way.
And, lastly, here is a link to gotype-live. (It may be a good idea to try and get this integrated into
gotype
proper, of course.)The text was updated successfully, but these errors were encountered: