castwide / atom-solargraph

An Atom package for Solargraph.
MIT License
39 stars 5 forks source link

Completion duplicates colon of symbol #8

Open MartyBeGood opened 6 years ago

MartyBeGood commented 6 years ago

The code completion sometimes duplicates the leading colon of a symbol.

Example code:

class MyModel < ApplicationRecord
  validates :name, presence: true
  validates | #cursor be here, we want to validate the password
end

Now you can experience the following:

  1. You start typing the name of the symbol, you won't find it in the autocomplete-list (because you haven't typed the leading colon)
  2. You type a colon, and select the symbol you want via arrow keys. You then press enter, symbol name gets placed with a single leading colon, everything is fine
  3. You type a colon and the first letters of the symbol you want. Your symbol is at the top of the autocomplete list. You type enter to have it autocompleted. It gets placed with an additional leading colon, which is quite annoying
castwide commented 6 years ago

Confirmed. This problem appears to be specific to Atom, although I've noticed a wart in VS Code's symbol autocompletion that may have the same root cause.

jezman commented 6 years ago

This problem can be solved?

chenjau commented 5 years ago

not only colons, 1.c (press tab) -> 1.cchr 1.ch (press tab) -> 1.chr 1.de (press tab) -> 1.dedenominator