Skip to content

Commit

Permalink
fix(format): formatOnSaveTimeout config with scope (#4689)
Browse files Browse the repository at this point in the history
otherwise language-override configuration like this won't work, always default value

```
  "[python]": {
    "coc.preferences.formatOnSaveTimeout": 5000
  },
```

closes fannheyward/coc-pyright#951
  • Loading branch information
fannheyward committed Aug 31, 2023
1 parent d432de2 commit 44898ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handler/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class FormatHandler {
return undefined
}
let options = await workspace.getFormatOptions(event.document.uri)
let formatOnSaveTimeout = workspace.initialConfiguration.get<number>('coc.preferences.formatOnSaveTimeout', 500)
let formatOnSaveTimeout = workspace.getConfiguration('coc.preferences', event.document).get('formatOnSaveTimeout', 500)
let timer: NodeJS.Timer
let tokenSource = new CancellationTokenSource()
const tp = new Promise<undefined>(c => {
Expand Down

0 comments on commit 44898ec

Please sign in to comment.