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

Renaming named imports mutates remote modules #1068

Closed
scarf005 opened this issue Feb 16, 2024 · 1 comment · Fixed by denoland/deno#22765
Closed

Renaming named imports mutates remote modules #1068

scarf005 opened this issue Feb 16, 2024 · 1 comment · Fixed by denoland/deno#22765
Assignees

Comments

@scarf005
Copy link

Describe the bug

renaming named imports for remote modules modifies remote modules when it musn't.

To Reproduce

import { SEPARATOR } from "https://deno.land/std@0.216.0/path/constants.ts"
  1. use deno's stdlib
  2. rename named imports (e.g sep)
import { SEPARATOR as sep } from "https://deno.land/std@0.216.0/path/constants.ts"

expected: imports are renamed correctly with as

import { sep } from "https://deno.land/std@0.216.0/path/constants.ts"

actual: the remote file itself is modified

Expected behavior

renames must not mutate remote Remote modules cache ($DENO_DIR/deps).

Screenshots

2024-02-16.4.04.42.mov

Versions

vscode: 1.86.2 deno: 1.40.5 extension: v3.33.3

@nayeemrmn nayeemrmn self-assigned this Mar 6, 2024
@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Mar 7, 2024

The 'Rename Symbol' functionality can't be used to create aliases, this is implemented in typescript Hmm, the typescript server creates as aliases when it's an import from an npm dependency. But that doesn't happen for remote deps...

As a stopgap we should rename only the file URLs and output a warning.

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

Successfully merging a pull request may close this issue.

2 participants