Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 Extension doesn't work for New Files #3006

Closed
1 task done
ZachHaber opened this issue Aug 4, 2022 · 2 comments · Fixed by #3140
Closed
1 task done

🐛 Extension doesn't work for New Files #3006

ZachHaber opened this issue Aug 4, 2022 · 2 comments · Fixed by #3140
Labels
E-VScode Editors: VSCode S-Bug: confirmed Status: report has been confirmed as a valid bug
Milestone

Comments

@ZachHaber
Copy link

Environment information

Rome Extension: v0.12.0
No Rome CLI installed globally or locally,

VSCode Env Info:
Version: 1.69.2 (user setup)
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Date: 2022-07-18T16:12:52.460Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Windows_NT x64 10.0.19044

What happened?

I don't have Rome installed separately from the extension.

  1. In a project configured with Rome
  2. Create a new file
  3. Add code to the file and set the language to Typescript or JS
  4. Attempt to format the file with Rome

image

The Rome Trace doesn't even see the attempt at running the formatter either.

Expected result

Rome should be able to format new files in VSCode. Even if that's the default because there's no approach to get access to the rome.json associated due to the lack of file paths.

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@ZachHaber ZachHaber added the S-To triage Status: user report of a possible bug that needs to be triaged label Aug 4, 2022
@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug E-VScode Editors: VSCode and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Aug 4, 2022
@ematipico ematipico added this to the 0.9.0 milestone Aug 4, 2022
@ematipico
Copy link
Contributor

It seems that our extension doesn't support formatting for newly created files:

Screenshot 2022-08-30 at 12 09 46

Not sure if it's a bug or a feature, but surely it's something we would like to support

@leops
Copy link
Contributor

leops commented Aug 30, 2022

Some technical information about this: at the moment the extension only activates on documents with the file:// scheme because we rely on the name of the file (and more specifically its extension) to determine the file type. In order to support files that do not have a path on disk yet, we'd need to provide an explicit file type to the workspace (probably derived from the language mode of the editor if we can access it over the LSP)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E-VScode Editors: VSCode S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants