Closed amurashkin17 closed 2 years ago
Hello @amurashkin17 👋🏻
Thanks for raising this issue. I think this boils down to the same problem as https://github.com/castwide/vscode-solargraph/issues/142. Essentially, the Solargraph language server does not support ERB, yet the Eclipse plugin is trying to send requests for ERB files. These end up failing with aforementioned Unexpected token tLT
error.
I think I'll simply need to exclude ERB files from the plugin - however, I'd still expect syntax highlighting and basic editor functionality to work. :)
In Eclipse, in any .erb file, at the first line containing
<%
, I see the following error messageFor example, the error happens if .erb file has the line
<%# comment %>
The software versions
Below is the detailed history.
Installing Ruby Solargraph and running it the first time
I installed Ruby Solargraph from the Eclipse Marketplace. After restart, I got a popup window saying that some gems were not found, with two buttons (cannot recall exact button names). I selected button ?install gems locally?. The installation failed.
In the Eclipse error log, there was the following message
I checked Eclipse preferences, and saw there that solargraph and readapt paths were empty.
Installing gems via command line
In Linux shell, I ran as my user (home directory /home/myuser)
These commands failed because /usr/include/ruby.h file was missing. So I installed ruby-devel package (as root) and repeated gem install commands.
After it, in Eclipse, I set executable paths in Solagraph preferences
Configuring .rubocop.yml
Then I opened .erb file and I got the error
Note 2.6 (not 3.1). So I looked for .rubocop.yml and found it
/home/myuser/.local/share/gem/ruby/gems/solargraph-0.47.2/lib/.rubocop.yml
I added TargetRubyVersion in AllCops section
and restarted Eclipse. After the restart the message still was the same - "Using Ruby 2.6 parser". So the language server did not use this file.
I created a symlink /home/myuser/.rubocop.yml pointing to /home/myuser/.local/share/gem/ruby/gems/solargraph-0.47.2/lib/.rubocop.yml. This time, after the Eclipse restart, the error message became "Using Ruby 3.1 parser".
Reinstalling Ruby Solargraph plugin
As the issue was not resolved, I attempted few more steps. I uninstalled Ruby Solargraph from Eclipse. Then I installed it again. After the restart, the error message was still there.
I checked the preferences, and the executable paths were still the same (as above).
There are no other errors in Eclipse error log.
How to troubleshoot?
The last thing that I did - I enabled "Troubleshoot Readapt debugger ..." option. But I have no idea where the log file is. Is it even going to be useful?