go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 571 forks source link

Improvement: Better broken code parsing. #2373

Open vburenin opened 8 years ago

vburenin commented 8 years ago

In the following example the parser could try and recover from the error better so that the remainder of the code can still work out:

package demo

func foo(&int) {

}

A quickfix for this would be to convert any & to * character but it can be addressed at a later time.


Original issue

image

This code sample contains a typo where instead of * I copy-pasted &, just because of that all autocomplete capabilities within this method are disabled. Code is not recognized.

It would be nice to have this error highlighted and all other functionality working.

dlsniper commented 8 years ago

@ignatov I'm attempting to work on this.

Where should I add the quickfix that should run for the issue above? I've made some work for this but when it comes to parameters inside function declarations I don't know where this gets triggered.

As for the parser itself, I still need to dig a bit to see how this could be improved (and I'm not familiar with that part of the plugin).

Thanks.