Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in virtual document with @ in path #74

Closed
ayame113 opened this issue Aug 3, 2021 · 1 comment · Fixed by atom-community/atom-languageclient#183 or #78
Closed

Error in virtual document with @ in path #74

ayame113 opened this issue Aug 3, 2021 · 1 comment · Fixed by atom-community/atom-languageclient#183 or #78

Comments

@ayame113
Copy link
Owner

ayame113 commented Aug 3, 2021

% 40 is encoded (decoded?) To% 2540.

I'm doing unnecessary encoding or decoding somewhere.

image

@ayame113
Copy link
Owner Author

ayame113 commented Aug 4, 2021

memo:
works in localy:

class Convert {
    static pathToUri(filePath) {
        if (new URL(filePath, 'file://').protocol!=="file:") {
            return filePath
        }
        let newPath = filePath.replace(/\\/g, "/");
        if (newPath[0] !== "/") {
            newPath = `/${newPath}`;
        }
        return encodeURI(`file://${newPath}`).replace(/[#?]/g, encodeURIComponent);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant