Skip to content

[TSServer] Formatting RulesProvider (re)initialization performance issues #13429

@jramsay

Description

@jramsay

The RulesProvider currently gets initialized in the LanguageService on the first formatting call to GetRuleProvider(). Initialization takes ~60ms. Every time the editor options change the RulesProvider's RuleMap is repopulated. When edits occur in a script block file (.html, .cshtml) and then a .js/.ts file the editor options change (ex: baseIndentation) and the RulesProvider is reinitialized.

Creating this item for perf improvements to the RulesProvider.

ex:

  1. Convert RulesProvider to be a singleton in TSServer
  2. Add another property to Rule to specify the ScriptKind or IsMixedContent type it applies to.

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions