Skip to content

Conversation

@jasonlyu123
Copy link
Contributor

Fixes #53290. I think The original fix for #52543 isn't in the correct order. In TypeScript 5.0 it became import { foo } from "\/foo"; instead of import { foo } from "$lib/foo";

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Mar 21, 2023
@jakebailey jakebailey requested a review from andrewbranch March 22, 2023 17:01
Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, quote was doing more work than I realized:

export function quote(sourceFile: SourceFile, preferences: UserPreferences, text: string): string {
    // Editors can pass in undefined or empty string - we want to infer the preference in those cases.
    const quotePreference = getQuotePreference(sourceFile, preferences);
    const quoted = JSON.stringify(text);
    return quotePreference === QuotePreference.Single ? `'${stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"')}'` : quoted;
}

JSON.stringify doubled up on the backslashes.

@andrewbranch andrewbranch merged commit 9f18c3f into microsoft:main Mar 22, 2023
@andrewbranch
Copy link
Member

Thanks @jasonlyu123!

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typescript shortened path with dollar sign does not autocomplete correctly

3 participants