-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed as not planned
Labels
type:duplicateIssues that are a duplicate of a previous issueIssues that are a duplicate of a previous issuetype:editor supportIssues about tools Prettier provides for use inside editor integrations.Issues about tools Prettier provides for use inside editor integrations.type:perfIssue with performance of PrettierIssue with performance of Prettier
Description
Hi all,
I was integrating prettier as a default extension in brackets editor. using formatWithCursor API to prettify code leads to hangs and general slowness.
Prettier is hosted in web worker inside brackets. formatWithCursor API is causing large delays and hangs in most large html files, but normal format api works just fine.
- Attached zip project with samples files that causing hangs. pretty.zip
- Also see this URL in dev tools to see a quick simple use case that hangs for several seconds in beautify API.
questions
- I could not find the use of
formatWithCursorin vscode extension code. How does the vscode extension handle cursor movement without using the API. - Is
formatWithCursorrecommended for usage within editors as i am seeing several seconds of delay to prettify code in not so large attached sample files.
Any help would be much appreciated.
Environments:
- Prettier Version: 2.7.1
- Running Prettier via: Browser API
- Runtime: Chrome v83, web worker
- Operating System: Linux
- Prettier plugins (if any): parser-html.js
Steps to reproduce:
- Extract the contents of pretty.zip
- open
index.htmlin any editor and see debugger. observe that the main thread hangs for several seconds on callingformatWithCursor.
Expected behavior:
- Gets result with cursor
Actual behavior:
- hangs browser
Thanks,
Arun
Metadata
Metadata
Assignees
Labels
type:duplicateIssues that are a duplicate of a previous issueIssues that are a duplicate of a previous issuetype:editor supportIssues about tools Prettier provides for use inside editor integrations.Issues about tools Prettier provides for use inside editor integrations.type:perfIssue with performance of PrettierIssue with performance of Prettier