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

feat: allow formatting and linting of in-memory files #63

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

nhedger
Copy link
Member

@nhedger nhedger commented Jan 3, 2024

This PR loosens the constraints of the document filter to allow linting and formatting in-memory files.

Related to biomejs/biome#1413


Fixes #35

@nhedger nhedger changed the title feat: allow formatting and linting in-memory files feat: allow formatting and linting of in-memory files Jan 3, 2024
@nhedger nhedger merged commit b65722f into main Jan 3, 2024
3 checks passed
@nhedger nhedger deleted the feat/untitled-files branch January 3, 2024 13:34
@jsejcksn
Copy link

jsejcksn commented Jan 4, 2024

@nhedger

Will this change allow the extension to format a document in the scenario described in the linked issue?

Ref:

  1. Close all VS Code windows and quit the app. Open a fresh instance of VS Code with a blank window and no workspace.
  2. Open a new editor tab and paste in some copied source code text (e.g. TypeScript)
  3. Verify that the language mode of the editor is correct for the pasted content (e.g. TypeScript) — in the case that it wasn't correctly auto-detected
  4. Use the VS Code command "Format Document" from the command palette

…whether or not there are any filesystem artifacts (like a config file), etc.

/cc @ematipico

@nhedger
Copy link
Member Author

nhedger commented Jan 4, 2024

Assuming that the extension is configured not to require the config file to be present, I believe it would work, but I'd have to try it to be certain.

I'll take a look tomorrow

@jsejcksn
Copy link

jsejcksn commented Jan 4, 2024

@nhedger

Assuming that the extension is configured not to require the config file to be present

Is this something that the user needs to explicitly configure? If so, what steps are needed?

I'll take a look tomorrow

Thanks — looking forward to it!

@nhedger
Copy link
Member Author

nhedger commented Jan 4, 2024

Is this something that the user needs to explicitly configure? If so, what steps are needed?

The biome.requireConfiguration option must be set to false. Currently true is the default.

In a future version of the extension this setting will be removed, so no user interaction will be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to format unsaved json files
3 participants