Skip to content

Conversation

@dbagley1
Copy link

Closes #3093. Adds support for language overrides for the prettier.printWidth configuration option in settings.json.

  • Updated the extension manifest to specify the language-overridable scope on prettier.printWidth

  • Updated getConfig() to respect language-specific settings by accepting activeTextEditor.document as the scope parameter. (workspace.getConfiguration() ignores language overrides when a URI is passed as the scope.)

  • Updated PrettierEditService to pass the activeTextEditor.document as the scope parameter if available and fallback to URI.

  • Run tests

  • Update the [CHANGELOG.md] with a summary of your changes

@SomaticIT
Copy link

Hello,
Good job!
Is it possible to add other options in language overrides?

@dbagley1
Copy link
Author

Thanks! Yes, updating other settings in the manifest with the language-overridable scope should work

@dbagley1
Copy link
Author

dbagley1 commented Nov 1, 2023

@SomaticIT @ntotten I'm a new contributor, is there any other action needed from me to progress this PR?

@SomaticIT
Copy link

I'm not a contributor of this repo.
However, I really suggest that you set other settings with the language-overridable to make this PR feature-complete.

Here is a list of properties that should be migrated:

  • prettier.tabWidth
  • prettier.singleQuote
  • prettier.trailingComma
  • prettier.bracketSpacing
  • prettier.singleAttributePerLine
  • prettier.bracketSameLine
  • prettier.jsxBracketSameLine
  • prettier.semi
  • prettier.requirePragma
  • prettier.insertPragma
  • prettier.useTabs
  • prettier.proseWrap
  • prettier.arrowParens
  • prettier.jsxSingleQuote
  • prettier.htmlWhitespaceSensitivity
  • prettier.vueIndentScriptAndStyle
  • prettier.endOfLine
  • prettier.quoteProps
  • prettier.embeddedLanguageFormatting

When, this is done, you should rename your PR like this:
Support Language Overrides on every .prettierrc options

This will make your PR more reusable and more attractive to core maintainers.

@github-actions
Copy link

github-actions bot commented Jan 1, 2024

This pull request has been labeled as stale due to inactivity. Reply to keep this pull request open.

@github-actions github-actions bot added the stale No recent activity label Jan 1, 2024
@github-actions github-actions bot closed this Jan 9, 2024
@ntotten ntotten reopened this Nov 27, 2025
@github-actions github-actions bot removed the stale No recent activity label Dec 4, 2025
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.

Language Overrides for printWidth Setting in VS Code

3 participants