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

Rename file by renaming on an aliased path #27959

Open
mjbvz opened this issue Oct 18, 2018 · 4 comments
Open

Rename file by renaming on an aliased path #27959

mjbvz opened this issue Oct 18, 2018 · 4 comments
Labels
Bug A bug in TypeScript Domain: TSServer Issues related to the TSServer
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Oct 18, 2018

From microsoft/vscode#60918

TypeScript Version: 3.2.0-dev.20181019

Search Terms:

  • rename
  • path rename

Code
For a simple js project

jsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es2016",
        "jsx": "preserve",
        "checkJs": true,
        "baseUrl": ".",
        "paths": {
            "~/*": [
                "*"
            ]
        }
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}

main.ts

import * as foo from '~/src/foo';

console.log(foo);

src/foo.js

export class Foo { }
  1. In main.js, f2 rename on foo in the path

Expected behavior:
This should allow renaming foo.js

Actual behavior:
See error: you cannot rename a module via a global import

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Oct 18, 2018
@mjbvz mjbvz removed VS Code Tracked There is a VS Code equivalent to this issue labels Nov 1, 2018
@weswigham weswigham added Bug A bug in TypeScript Domain: TSServer Issues related to the TSServer labels Nov 1, 2018
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 14, 2019
@heavenkiller2018
Copy link

is there any plan to fix it?

@varthc
Copy link

varthc commented Sep 30, 2023

Any update? Thanks!

@timoisalive
Copy link

Yep, hoping to see a fix to this as well, now that also Expo projects support path aliases (https://docs.expo.dev/guides/typescript/#path-aliases).

@simplenotezy
Copy link

This have been mentioned many times across different issues, but I don't see any solution. Is there one, or are we just currently doomed if we use aliased imports?

microsoft/vscode#97135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: TSServer Issues related to the TSServer
Projects
None yet
Development

No branches or pull requests

7 participants