iqbalansari / emacs-emojify

Display emojis in Emacs
GNU General Public License v3.0
409 stars 40 forks source link

Emojify messing with company-mode tooltips #54

Closed pablo-abc closed 5 years ago

pablo-abc commented 5 years ago

Lately, with emojify globally enabled, company mode has stopped working sometimes when a tooltip needs to be displayed with the following error:

Company: An error occurred in post-command
Company: frontend company-pseudo-tooltip-unless-just-one-frontend error Wrong type argument: characterp, (cl -128 97 tl) on command post-command

Using the debugger shows me this:

Debugger entered--Lisp error: (wrong-type-argument characterp (cl -128 97 tl))
  char-to-string((cl -128 97 tl))
  mapcar(char-to-string [9 (cl -128 97 tl)])
  emojify--get-composed-text(98)
  emojify-display-emojis-in-region(1 377 nil)
  emojify-string(#("  }      accountRepository p \n         create            m \n  find(d find              m options?: FindManyOptions<Account>) {\n    retu findOne           m tory.find({ ...data, ...options });\n  }      login             m \n        \n  findOne(data: FindAccountDto, options?: FindOneOptions<Account>) {\n    return this.accountRepository.findOne(data, options);\n  }     \n        \n" 0 2 (fontified t face (default)) 2 3 (fontified t face (rainbow-delimiters-depth-2-face default)) 3 8 (face (default)) 8 9 (mouse-face (company-tooltip-mouse) face (company-tooltip-selection company-tooltip default)) 9 10 (prefix "" completion (:name #("accountRepository" 0 1 (file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) completion #2 prefix "")) :kind "property" :kindModifiers "private" :sortText "0") file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) mouse-face (company-tooltip-mouse) face (company-tooltip-selection company-tooltip default)) 10 27 (mouse-face (company-tooltip-mouse) face (company-tooltip-selection company-tooltip default)) 27 28 (mouse-face (company-tooltip-mouse) face (company-tooltip-annotation-selection company-tooltip-selection company-tooltip default)) 28 29 (mouse-face (company-tooltip-mouse) face (company-tooltip-selection company-tooltip default)) 29 38 (face (default)) 38 39 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 39 40 (prefix "" completion (:name #("create" 0 1 (file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) completion #2 prefix "")) :kind "method" :kindModifiers "" :sortText "0") file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) mouse-face (company-tooltip-mouse) face (company-tooltip default)) 40 57 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 57 58 (mouse-face (company-tooltip-mouse) face (company-tooltip-annotation company-tooltip default)) 58 59 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 59 60 (face (default)) 60 66 (fontified t face (default)) 66 67 (fontified t face (rainbow-delimiters-depth-2-face default)) 67 68 (fontified t face (default)) 68 69 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 69 70 (prefix "" completion (:name #("find" 0 1 (file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) completion #2 prefix "")) :kind "method" :kindModifiers "" :sortText "0") file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) mouse-face (company-tooltip-mouse) face (company-tooltip default)) 70 87 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 87 88 (mouse-face (company-tooltip-mouse) face (company-tooltip-annotation company-tooltip default)) 88 89 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 89 97 (fontified t face (default)) 97 98 (fontified t composition (2 1 [9 57708]) face (default)) 98 123 (fontified t face (default)) 123 124 (face (rainbow-delimiters-depth-2-face default) fontified t) 124 125 (fontified t face (default)) 125 126 (face (rainbow-delimiters-depth-2-face default) fontified t) 126 127 (face (default)) 127 131 (fontified t face (default)) 131 135 (fontified t face (font-lock-keyword-face default)) 135 136 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 136 137 (prefix "" completion (:name #("findOne" 0 1 (file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) completion #2 prefix "")) :kind "method" :kindModifiers "" :sortText "0") file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) mouse-face (company-tooltip-mouse) face (company-tooltip default)) 137 154 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 154 155 (mouse-face (company-tooltip-mouse) face (company-tooltip-annotation company-tooltip default)) 155 156 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 156 165 (fontified t face (default)) 165 166 (face (rainbow-delimiters-depth-3-face default) fontified t) 166 167 (face (rainbow-delimiters-depth-4-face default) fontified t) 167 168 (fontified t face (default)) 168 170 (fontified t composition (7 3 [9 57638]) face (default)) 170 171 (fontified t composition (7 3 [9 57638]) face (default)) 171 177 (fontified t face (default)) 177 179 (fontified t composition (7 3 [9 57638]) face (default)) 179 180 (fontified t composition (7 3 [9 57638]) face (default)) 180 188 (fontified t face (default)) 188 189 (face (rainbow-delimiters-depth-4-face default) fontified t) 189 190 (face (rainbow-delimiters-depth-3-face default) fontified t) 190 191 (fontified t face (default)) 191 192 (face (default)) 192 194 (fontified t face (default)) 194 195 (fontified t face (rainbow-delimiters-depth-2-face default)) 195 200 (face (default)) 200 201 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 201 202 (prefix "" completion (:name #("login" 0 1 (file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) completion #2 prefix "")) :kind "method" :kindModifiers "" :sortText "0") file-location (:file "/home/pberganza/Documents/Personal/blog/nestjs-apollo-graphql-demo/api/src/accounts/accounts.service.ts" :line 19 :offset 10 :includeExternalModuleExports t :includeInsertTextCompletions t) mouse-face (company-tooltip-mouse) face (company-tooltip default)) 202 219 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 219 220 (mouse-face (company-tooltip-mouse) face (company-tooltip-annotation company-tooltip default)) 220 221 (mouse-face (company-tooltip-mouse) face (company-tooltip default)) 221 231 (face (default)) 231 239 (fontified t face (default)) 239 240 (fontified t face (default)) 240 241 (face (rainbow-delimiters-depth-2-face default) fontified t) 241 245 (fontified t face (default)) 245 246 (fontified t composition (2 1 [9 57708]) face (default)) 246 271 (fontified t face (default)) 271 272 (fontified t composition (2 1 [9 57708]) face (default)) 272 296 (fontified t face (default)) 296 297 (face (rainbow-delimiters-depth-2-face default) fontified t) 297 298 (fontified t face (default)) 298 299 (face (rainbow-delimiters-depth-2-face default) fontified t) 299 300 (face (default)) 300 304 (fontified t face (default)) 304 308 (fontified t face (font-lock-keyword-face default)) 308 310 (face (font-lock-keyword-face default) fontified t) 310 311 (fontified t face (default)) 311 315 (face (font-lock-keyword-face default) fontified t) 315 341 (fontified t face (default)) 341 342 (face (rainbow-delimiters-depth-3-face default) fontified t) 342 355 (fontified t face (default)) 355 356 (face (rainbow-delimiters-depth-3-face default) fontified t) 356 357 (fontified t face (default)) 357 358 (face (default)) 358 360 (fontified t face (default)) 360 361 (fontified t face (rainbow-delimiters-depth-2-face default)) 361 376 (face (default))) (unicode))
  ad-Advice-company-pseudo-tooltip-unhide(#f(compiled-function () #<bytecode 0x16e9f15>))
  apply(ad-Advice-company-pseudo-tooltip-unhide #f(compiled-function () #<bytecode 0x16e9f15>) nil)
  company-pseudo-tooltip-unhide()
  company-pseudo-tooltip-frontend(post-command)
  company-pseudo-tooltip-unless-just-one-frontend(post-command)
  company-call-frontends(post-command)
  company-post-command()
  company-idle-begin(#<buffer accounts.service.ts> #<window 3 on accounts.service.ts> 139 688)
  apply(company-idle-begin (#<buffer accounts.service.ts> #<window 3 on accounts.service.ts> 139 688))
  timer-event-handler([t 23808 24520 734308 nil company-idle-begin (#<buffer accounts.service.ts> #<window 3 on accounts.service.ts> 139 688) nil 553000])

Disabling emojify made everything work normally.

iqbalansari commented 5 years ago

Hi @pablo-abc, thanks for the bug report and sorry for the trouble, I have pushed a fix for the issue on master, could you please try this once MELPA updates

Thanks

pablo-abc commented 5 years ago

Thanks a lot! It seems to be working perfectly now.

And seriously, no need to apologize at all. Amazing work <3