Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Filenames with % breaks server #422

@autozimu

Description

@autozimu

For a simplified situation, in a folder named sample-js, with two files,

  • test.js
  • %test.js

The server will quit with this error

/usr/local/lib/node_modules/javascript-typescript-langserver/lib/util.js:46
    const pathParts = parts.pathname.split('/').map(segment => encodeURIComponent(decodeURIComponent(segment)));
                                                                                  ^

URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at parts.pathname.split.map.segment (/usr/local/lib/node_modules/javascript-typescript-langserver/lib/util.js:46:83)
    at Array.map (<anonymous>)
    at Object.normalizeUri (/usr/local/lib/node_modules/javascript-typescript-langserver/lib/util.js:46:49)
    at Glob.globber.on (/usr/local/lib/node_modules/javascript-typescript-langserver/lib/fs.js:62:40)
    at Glob.emit (events.js:159:13)
    at Glob._emitMatch (/usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:489:8)
    at Glob._processSimple2 (/usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:705:8)
    at /usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:789:10)

File names like % are used by vim as backup files and are not rare to encounter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions