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

file rename works for import but not include #808

Closed
Eric-Song-Nop opened this issue Nov 13, 2024 · 3 comments · Fixed by #869
Closed

file rename works for import but not include #808

Eric-Song-Nop opened this issue Nov 13, 2024 · 3 comments · Fixed by #869
Labels
enhancement New feature or request

Comments

@Eric-Song-Nop
Copy link
Collaborator

Describe the bug
For features implemented in #645 and #648, they only work for import but not include, for specifically, the do_rename_file function only consider import as dependency not include.

When renaming a include, the file will be rename, but not the symbol.

Package/Software version:

tinymist 
Build Timestamp:     2024-11-13T16:40:47.728123393Z
Build Git Describe:  v0.12.0-42-g5616a3f-dirty
Commit SHA:          5616a3fb34df5374963e57754269a054009a85bd
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: x86_64-unknown-linux-gnu
Typst Version:       0.12.0
Typst Source:        git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.12.0#58426a90a7ef721738a01be09793d33e55eb75a9
@Eric-Song-Nop
Copy link
Collaborator Author

Seems that the struct:

pub struct ModuleDependency {
    /// The dependencies of this module.
    pub dependencies: EcoVec<TypstFileId>,
    /// The dependents of this module.
    pub dependents: EcoVec<TypstFileId>,
}

considers only import, but not include, the question is should we include include in this struct, and collects with import?

@Myriad-Dreamin
Copy link
Owner

The module dependencies only refer to the relations affecting code analysis, therefore the include paths are not taken into account. In fact, there are also need to rename with regard to other paths within source files, like paths in #image or #bibliography calls. We may solve them all together.

@Myriad-Dreamin Myriad-Dreamin added the enhancement New feature or request label Nov 15, 2024
@Eric-Song-Nop
Copy link
Collaborator Author

I got it, include is more similar to #image or #bibliography, however, when I rename on an #include, it will rename the file, I hope to temporarily disable this feature before the feature is fully implemented.

@Myriad-Dreamin Myriad-Dreamin linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants