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

Code action to create file #1941

Open
SoraTenshi opened this issue Jul 6, 2024 · 0 comments
Open

Code action to create file #1941

SoraTenshi opened this issue Jul 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@SoraTenshi
Copy link
Contributor

SoraTenshi commented Jul 6, 2024

Story

While working on Zig bindings, i was translating quite a bit of C to Zig, so i also tried and structure the code in a way, that i have quite a bit of files.
A common pattern that arose is the following:

const Register = @import("register.zig").Register; // This file does not exist (yet)
// ....
const Something = extern struct {
    reg: Register,
    // ...
};

I would think that a code action to just create the file in the corresponding folder would be a great improvement for this specific workflow, but even in other workflows this would make a lot of sense in my opinion.

Being more concrete

Let's imagine the following folder-structure:

──  src
  ├──  linux
  │  └──  import.zig
  └──  windows
     └──  import.zig

and then imagine within the linux/import.zig folder the following Line:
const fs = @import("file_system.zig");
It would just make sense that a code action would create the file in the assumed folder, so that it would result in:

──  src
  ├──  linux
  │  ├──  file_system.zig
  │  └──  import.zig
  └──  windows
     └──  import.zig

Another point i'd say supporting this idea is, that probably most people are mostly working in the root of their project, so it would always be a bit cumbersome for us to create the file in the corresponding folder.

@SoraTenshi SoraTenshi added the enhancement New feature or request label Jul 6, 2024
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

No branches or pull requests

1 participant