hylang / hy-mode

Hy mode for Emacs
GNU General Public License v3.0
189 stars 48 forks source link

Fix: don't complete when in comment or string #97

Closed TatriX closed 3 years ago

TatriX commented 3 years ago

Currently when company-hy is asked for a prefix it just calls (company-grab-symbol). If this happens inside the string no meaningful completion can be done and company-hy should return nil. This PR adds a check for this with (company-in-string-or-comment), thus giving option to other backbends to do their work.

Most notable this allows file completion via company-files inside strings, so

(pd.read-csv "./") ;; will complete files instead of doing nothing