File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/jupyterlab-lsp/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export class LanguageServerManager implements ILanguageServerManager {
2323 private _retries : number ;
2424 private _retriesInterval : number ;
2525 private _configuration : TLanguageServerConfigurations ;
26+ private _warningsEmitted = new Set < string > ( ) ;
2627 private console : ILSPLogConsole ;
2728
2829 constructor ( options : ILanguageServerManager . IOptions ) {
@@ -52,12 +53,19 @@ export class LanguageServerManager implements ILanguageServerManager {
5253 this . _configuration = configuration ;
5354 }
5455
56+ protected warnOnce ( arg : string ) {
57+ if ( ! this . _warningsEmitted . has ( arg ) ) {
58+ this . _warningsEmitted . add ( arg ) ;
59+ this . console . warn ( arg ) ;
60+ }
61+ }
62+
5563 protected _comparePriorities ( a : TLanguageServerId , b : TLanguageServerId ) {
5664 const DEFAULT_PRIORITY = 50 ;
5765 const a_priority = this . _configuration [ a ] ?. priority ?? DEFAULT_PRIORITY ;
5866 const b_priority = this . _configuration [ b ] ?. priority ?? DEFAULT_PRIORITY ;
5967 if ( a_priority == b_priority ) {
60- this . console . warn (
68+ this . warnOnce (
6169 `Two matching servers: ${ a } and ${ b } have the same priority; choose which one to use by changing the priority in Advanced Settings Editor`
6270 ) ;
6371 return a . localeCompare ( b ) ;
You can’t perform that action at this time.
0 commit comments