VSCode ruby - autocomplete suggestions not showing when typing lowercase characters - ruby-on-rails

I'm working on a Rails project in VsCode and the autocomplete feature does not work well for ruby - it autocompletes well if I type something starting with upper case letter only, lowercase usually dont get any autocomplete (unless it a lowcase var name with underscores) - here is a screencast that shows that. I already tried disabling some extensions that might affect autocomplete (VSCode Ruby, Solargraph, Tabnine, Ruby), I also unchecked 'Snippets Prevent Quick Suggestions'. Any suggestions (ha!) how to fix this?

Related

Create custom ruby text transformations in Rubymine

I thought this would be something built in and easy to do in Rubymine but I haven't been able to find any references to it let alone possible answers. Maybe I am phrasing my searches all wrong? I want to create a simple ruby script that I can use to transform text in Rubymine. I have to do a lot of snake_case to titleize transformations in my writing of some rails forms. I wish I could highlight some text and right click -> Titleize and have it happen, but Rubymine only does upcase/downcase or snake_case/camelCase conversions. It seems like I should be able to write a simple script like:
require 'active_support'
gets some_string
some_string.titleize
and assign it to a menu item. Any ideas? Right now I open the terminal panel in Rubymine where I have rails c running and copy/paste -> .titleize -> copy/paste.
I don't believe there is a way to do this right now using ruby. The use of RubyMine macros is quite limited, think you could take a look to some simple plugin like CamelCase take it apart and see what they are doing, but that would force you to use Java I guess.
However if you are interested only in the specific case of
snake_case > Snakecase
For that you could install the CamelCase and record a macro and assign it to a any shortcut you like , the macro itself would do this
ALT+SHIFT+U > SnakeCase
CTRL+SHIFT+U > snakecase
ALT+SHIFT+U > Snakecase
Hope that helps.

Sublime Text 2: How to set up consistent syntax highlighting for Guardfile?

While it is easy enough to set the language for a given (open) file in Sublime Text, I'm wondering if there is any way that I can tell the editor in advance that anything called "Guardfile" should be highlighted like it's Ruby code. Does anyone know how to do this?
The plugins recommended in the comments by Brian both do the job nicely:
ApplySyntax
SyntaxFromFileName
Update:
I couldn't get SyntaxFromFileName to match any of my regex for some reason. On the other hand, DetectSyntax comes with syntax highlight for the Guardfile built in.
Update2:
DetectSyntax has been renamed to ApplySyntax
Putting the following at the top of said file also works
#!/usr/bin/env ruby

How to get the rails.vim-command :Rview working with .js.erb-views?

I want Rview to jump to .js.erb-views as well.
It always says "Can't find file "app/views/examples/foo".
The help says:
rails-template-types
Commands like :Rview use a hardwired list of
extensions (erb, rjs, etc.) when searching for files. In order to
facilitate working with non-standard template types, several popular
extensions are featured in this list, including haml, liquid, and mab
(markaby). These extensions will disappear once a related
configuration option is added to rails.vim.
Since the view ends with .erb, i would suggest it should work.
Any Ideas?
This is strange, I just checked in my vim and it works fine. I use Janus, but I think that the standard vim + rails.vim should work well.
Maybe you need to update rails.vim?
And you can tell the sequence of your actions: the current file, typed commands, etc.

Textmate check spelling everywhere

Is there any way to check spelling for ALL the words that I type in Textmate?
It's hard to believe but I actually use legit English words for ALL my variables and class names - thus unhighlighted typos are just killing me.
It would be nice if there was a way to check spelling for words with special characters (#uesr, crreunt_uesr)
I am using Textmate for Rails if that matters.
From the manual;
4.10 Spell Checking
TextMate supports the system wide 'Check Spelling as You Type'. This
can be changed in the Edit → Spelling submenu.
You can bring up the context sensitive menu for a misspelled word to
get spelling suggestions.
Since TextMate is intended for structured text it is possible to
exclude parts of the document from being checked. This is done by
creating a preferences item in the bundle editor, setting
spellChecking to 0 and filling in the scope selector with the selector
to target for no spell checking.
By default spell checking is disabled for source code except strings
and comments and also for keywords, tags and similar in HTML, LaTeX,
Markdown, etc.

Problems with Netbeans re: Rails erb/rhtml intellisense?

I've been using Netbeans for Rails and like it a lot, considering how little I paid for it. But something that bothers me is that when I'm editing an RHTML or ERB file, it doesn't do the code autocomplete - or at least not reliably. Sometimes it shows the appropriate variables and methods that are available on an object after you type the dot operator. Sometimes it ignores the instance variables. Is there a solution for this? (Please don't say RadRails).
Oh and one more thing in case anyone has solved this: considering how often I have to type <% when I'm in a Rails template, I wish there was some hotkey for autotyping the tag . . . ? I always have to stop and look down at my keyboard to find the < and % keys before I can type the tag so it's not as trivial as it might sound.
I believe you're looking for something like this:
http://ruby.netbeans.org/codetemplates-rhtml.html
Type in one of the triggers, then hit the tab key to expand it to the code as given.
Also, you might want to explore using HAML. It's much easier on the hands.

Resources