Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('local function') contains HTML space characters, which are not valid in tokens. #353

Closed

Description

@basarat

If I return a type like local function in a suggestion.

Atom Version: 0.189.0
System: Microsoft Windows 8 Pro
Thrown From: autocomplete-plus package, v2.8.0

Stack Trace

Uncaught InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('local function') contains HTML space characters, which are not valid in tokens.

At C:\Users\bas\.atom\packages\autocomplete-plus\lib\suggestion-list-element.coffee:156

Error: Failed to execute 'add' on 'DOMTokenList': The token provided ('local function') contains HTML space characters, which are not valid in tokens.
  at Error (native)
  at autocomplete-suggestion-list.SuggestionListElement.renderItem (C:\Users\bas\.atom\packages\autocomplete-plus\lib\suggestion-list-element.coffee:156:26)
  at autocomplete-suggestion-list.SuggestionListElement.renderItems (C:\Users\bas\.atom\packages\autocomplete-plus\lib\suggestion-list-element.coffee:129:6)
  at C:\Users\bas\.atom\packages\autocomplete-plus\lib\suggestion-list-element.coffee:67:35
  at ViewRegistry.module.exports.ViewRegistry.performDocumentUpdate (C:\Users\bas\AppData\Local\atom\app-0.189.0\resources\app\src\view-registry.js:159:9)
  at __bind (C:\Users\bas\AppData\Local\atom\app-0.189.0\resources\app\src\view-registry.js:3:61)

Commands

     -0:26.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -0:25.7 editor:move-to-end-of-word (atom-text-editor.editor.is-focused)
     -0:25.0 editor:select-to-end-of-word (atom-text-editor.editor.is-focused)
     -0:22.5 typescript:format-code (atom-text-editor.editor.is-focused)
     -0:22.2 core:save (atom-text-editor.editor.is-focused)
  2x -0:13.0 core:select-down (atom-text-editor.editor.is-focused)
     -0:12.4 core:backspace (atom-text-editor.editor.is-focused)
  3x -0:11.9 core:move-down (atom-text-editor.editor.is-focused)
     -0:11.2 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -0:10.8 editor:select-to-first-character-of-line (atom-text-editor.editor.is-focused)
     -0:10.2 core:move-up (atom-text-editor.editor.is-focused)
     -0:09.8 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
  2x -0:09.4 core:select-down (atom-text-editor.editor.is-focused)
     -0:09.1 core:select-right (atom-text-editor.editor.is-focused)
  5x -0:06.6 core:backspace (atom-text-editor.editor.is-focused)
     -0:00.6 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ]
  },
  "autocomplete-plus": {}
}

Installed Packages

# User
atom-typescript, v2.4.0
atom-typescript-test, v0.0.0
autocomplete-plus, v2.8.0
last-cursor-position, v0.7.0
linter, v0.12.0
minimap, v4.7.5
minimap-find-and-replace, v4.2.0
minimap-git-diff, v4.1.2
minimap-selection, v4.2.0
monokai, v0.13.0
project-manager, v1.15.5

# Dev
No dev packages

Activity

  1. joefitzgerald commented on Apr 3, 2015

    @joefitzgerald
    Contributor

    Type should be a single word. Choose local. Or function.

  2. benogle commented on Apr 3, 2015

    @benogle
    Contributor

    It should probably not break in this. And you should choose function for
    type in that case

    On Friday, April 3, 2015, Joe Fitzgerald [email protected] wrote:

    Type should be a single word. Choose local. Or function.

    —
    Reply to this email directly or view it on GitHub
    https://github.com/atom-community/autocomplete-plus/issues/353#issuecomment-89259520
    .

  3. basarat commented on Apr 4, 2015

    @basarat
    Author

    Yes I should and did use function to fix it. However created this issue because other people might run into the same and get the "error box" and wanted to bring it to your notice ❤️

  4. joefitzgerald commented on Apr 4, 2015

    @joefitzgerald
    Contributor

    The error seems pretty clear about the actions required to resolve the issue. I don't think this needs a fix.

  5. joefitzgerald commented on Apr 4, 2015

    @joefitzgerald
    Contributor

    I suppose the alternative would be for autocomplete plus to split on space and use the first word, instead of erroring. We could use the extended description in a popover or similar, or set leftLabel with this if it is empty.

  6. basarat commented on Apr 4, 2015

    @basarat
    Author

    The error seems pretty clear about the actions required to resolve the issue

    Yes. 👍 for that.

    But again would like this to not error. Don't want to depend on lazy autocomplete package authors like me to ensure a valid type 👍 (I was just passing through what typescript gave to me as a first step 😄 )

  7. added a commit that references this issue on Jul 7, 2015
    d988fc9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions