rails icon indicating copy to clipboard operation
rails copied to clipboard

Error using Rubocop

Open gabrielrinaldi opened this issue 2 years ago • 6 comments

I am getting an error when the extensions starts:

Ruby on Rails[22:26:00.090000] Extension encountered an uncaught exception:
/Users/gabriel/Library/Application Support/Nova/Extensions/com.tommasonegri.Rails/Scripts/main.js (Line 38, Column 36)
TypeError: undefined is not an object (evaluating 'nova.workspace.activeTextEditor.onDidSave')
    @file:///Users/gabriel/Library/Application%20Support/Nova/Extensions/com.tommasonegri.Rails/Scripts/main.js:38:36

My suspicion is that this is what is causing Rubocop to not work. I cannot get the autocorrect to work.

gabrielrinaldi avatar Dec 08 '22 05:12 gabrielrinaldi

I'm also seeing this. Looking into the code, this happens when the extension is activated and no text editors are open (a cold boot of the application).

I'm working on a possible fix.

mgoggin avatar Dec 12 '22 17:12 mgoggin

Hi there! Thanks for reporting the issue.

@mgoggin thanks for taking a look at it. If you find the solution, please fell free to open a PR.

Although I have to say that I'm working on a complete rewrite of the Solargraph integration. It will be released in a new extension like the new Ruby debugger I published last week. The idea going forward is to refactor and extract all the features not directly Rails specific into dedicated extensions and at the same time making sure they all work well together. I hope this new module ecosystem will allow all the rubyist to peek and choose just what they need, even if they are not using Rails. More on this in the future...

tommasongr avatar Dec 12 '22 18:12 tommasongr

@tommasongr that is great news! It is hard to find which extensions I need currently, having a set of extensions that are compatible and you can install what you need will be perfect.

gabrielrinaldi avatar Dec 12 '22 18:12 gabrielrinaldi

@gabrielrinaldi I'm happy you like the idea! I've already received a couple of other feedback and they all seem to agree on the approach. What we need to tackle right is communication, as you mentioned right now there is not an easy way to know what extension you need for the job. I'll probably add an explanatory section in the README of each piece and eventually it would be nice to make a little website for the ecosystem as well.

tommasongr avatar Dec 12 '22 18:12 tommasongr

Hi there! Here it is my little Christmas present: https://github.com/nova-ruby/solargraph

If you want to start using the new Solargraph extension make sure to disable it from the Ruby on Rails extension

CleanShot 2022-12-24 at 10 39 35@2x

tommasongr avatar Dec 24 '22 09:12 tommasongr

I started using this today, sorry I missed this. I'll post back here if I encounter any issues.

gabrielrinaldi avatar Apr 24 '23 16:04 gabrielrinaldi