File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { Disposable , TextEditor } from "atom"
22
3- export interface Provider {
3+ export interface ProviderCommon {
44 // Providers with higher priorities will be preferred over lower ones.
55 priority : number
66 // Omitting grammarScopes implies that the provider applies to all grammars.
7- grammarScopes ?: Array < string >
7+ grammarScopes ?: Array < string > ,
88}
99
10- export class ProviderRegistry {
10+ export class ProviderRegistry < Provider extends ProviderCommon > {
1111 private providers : Array < Provider >
1212
1313 constructor ( ) {
1414 this . providers = [ ]
1515 }
1616
1717 addProvider ( provider : Provider ) : Disposable {
18- const index = this . providers . findIndex ( ( p : Provider ) => provider . priority > p . priority )
18+ const index = this . providers . findIndex ( ( p ) => provider . priority > p . priority )
1919 if ( index === - 1 ) {
2020 this . providers . push ( provider )
2121 } else {
You can’t perform that action at this time.
0 commit comments