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

[Not Ready] [typespec-vscode] Rename file should rename import #5674

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mzhongl524
Copy link
Member

fixed: #2470

  • Compiler:
    Locate the file with the modified import content and modify it

  • Typespec-vscode:
    Add implementation code such as configuration content and user-friendly operations

@mzhongl524 mzhongl524 added the ide Issues for VS, VSCode, Monaco, etc. label Jan 21, 2025
@@ -281,6 +281,34 @@ export function getPathComponents(path: string, currentDirectory = "") {
return pathComponents(path, getRootLength(path));
}

export function getRelativePathByComparePaths(from: string, to: string): string {
if (from.length === 0 || to.length === 0 || from === to) {
Copy link
Contributor

Choose a reason for hiding this comment

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

the path-util is copied from vscode, we won't change it.

Copy link
Member

Choose a reason for hiding this comment

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

There is also already a get relative path above

@timotheeguerin timotheeguerin marked this pull request as draft January 21, 2025 16:06
@@ -85,6 +85,25 @@ export class TspLanguageClient {
}
}

async updateImportsOnFileMovedOrRenamed(
Copy link
Member

Choose a reason for hiding this comment

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

can this not be done in the language server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IDE] Renaming a file should rename the imports
3 participants