forked from phindle/error-lens
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add command to force update decorations
- Loading branch information
1 parent
45521ba
commit 6869ea1
Showing
5 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { clearDecorations, updateDecorationsForUri } from 'src/decorations'; | ||
import { $state } from 'src/extension'; | ||
import { extUtils } from 'src/utils/extUtils'; | ||
import { languages, window } from 'vscode'; | ||
|
||
interface UpdateEverythingArgs { | ||
kind?: 'update' | 'clear'; | ||
} | ||
|
||
export function updateEverythingCommand(arg?: UpdateEverythingArgs): void { | ||
for (const editor of window.visibleTextEditors) { | ||
if (arg?.kind === 'clear') { | ||
clearDecorations({ editor }); | ||
} else { | ||
updateDecorationsForUri({ | ||
uri: editor.document.uri, | ||
editor, | ||
}); | ||
$state.statusBarMessage.updateText(editor, extUtils.groupDiagnosticsByLine(languages.getDiagnostics(editor.document.uri))); | ||
} | ||
} | ||
|
||
$state.statusBarIcons.updateText(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters