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

Feature request: add a toggle hide/show generated files, open generated file #413

Closed
prscoelho opened this issue May 12, 2022 · 4 comments · Fixed by #419
Closed

Feature request: add a toggle hide/show generated files, open generated file #413

prscoelho opened this issue May 12, 2022 · 4 comments · Fixed by #419
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@prscoelho
Copy link

prscoelho commented May 12, 2022

Hey guys.

I can hide generated files but I know this isn't considered best practice, you're supposed to look at the generated file to see if you've messed things up. But having a bunch of generated files in your tree list can be a noisy.

I thought of two commands that might be useful:

  • Toggle show/hide generated files (is this something that's doable through lsp?)
  • Goto generated file for current buffer nevermind, there's an open compiled command!
@zth
Copy link
Collaborator

zth commented May 12, 2022

VSCode just released a feature for grouping files together. That might be something we could implement for the VSCode extension specifically, to nest generated files collapsed under the source file:

https://code.visualstudio.com/updates/v1_67#_explorer-file-nesting

^- Happy to guide/help if someone wants to take a stab at experimenting with/adding that.

@zth zth added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 12, 2022
@Kingdutch
Copy link

No update to the extension is needed if people are willing to edit their own settings :D

Open your VS Code settings and type "editor.filenesting", enable the feature and scroll down to patterns.

I've added two patterns:
*.res pointing to ${capture}.mjs and *.resi pointing to ${capture.resi}

This nests implementations under interfaces if they're present and nests all generated files under the main ReScript file. Cleaning up the explorer nicely. As you can see for vite.resi it does not create nesting when both an interface and compiled file are present but instead keeps them both under the top level interface directly :D

image

I think maybe the only added benefit for adding this to the rescript-vscode extension would be to automatically use the configured extension from bsconfig.json. However, if the extension were to hardcode this pattern we may actually decrease usability because people may want to enable nesting but omit certain patterns (e.g. I personally removed nesting yarn.lock under package.json because I prefer having those separate while using the nesting for ReScript).

@zth
Copy link
Collaborator

zth commented May 12, 2022

@Kingdutch very good point! Maybe we should just document how you can add that config yourself in the readme? Does anyone read the readme? 😄

@prscoelho
Copy link
Author

Oh I didn't know about file nesting! This is great.

Please do add the open compiled command to the readme as well, I looked for it before opening this issue, but then I found it by looking at the code. I was also searching for "generated", which I guess is the wrong term?

@zth zth mentioned this issue May 12, 2022
@zth zth closed this as completed in #419 May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants