mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Add jsxAttributeCompletionStyle setting (#133920)
* Add jsxAttributeCompletionStyle setting * Apply suggestions from code review Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
This commit is contained in:
@@ -191,6 +191,8 @@ export default class FileConfigurationManager extends Disposable {
|
||||
quotePreference: this.getQuoteStylePreference(preferencesConfig),
|
||||
importModuleSpecifierPreference: getImportModuleSpecifierPreference(preferencesConfig),
|
||||
importModuleSpecifierEnding: getImportModuleSpecifierEndingPreference(preferencesConfig),
|
||||
// @ts-expect-error until TS 4.5 protocol update
|
||||
jsxAttributeCompletionStyle: getJsxAttributeCompletionStyle(preferencesConfig),
|
||||
allowTextChangesInNewFiles: document.uri.scheme === fileSchemes.file,
|
||||
providePrefixAndSuffixTextForRename: preferencesConfig.get<boolean>('renameShorthandProperties', true) === false ? false : preferencesConfig.get<boolean>('useAliasesForRenames', true),
|
||||
allowRenameOfImportPath: true,
|
||||
@@ -263,3 +265,11 @@ function getImportModuleSpecifierEndingPreference(config: vscode.WorkspaceConfig
|
||||
default: return 'auto';
|
||||
}
|
||||
}
|
||||
|
||||
function getJsxAttributeCompletionStyle(config: vscode.WorkspaceConfiguration) {
|
||||
switch (config.get<string>('jsxAttributeCompletionStyle')) {
|
||||
case 'braces': return 'braces';
|
||||
case 'none': return 'none';
|
||||
default: return 'auto';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user