@@ -15,6 +15,7 @@ import {
1515import { Extension , MapMode } from "@codemirror/state" ;
1616import { EditorView , keymap } from "@codemirror/view" ;
1717import lspStatusBar from "components/lspStatusBar" ;
18+ import NotificationManager from "lib/notificationManager" ;
1819import Uri from "utils/Uri" ;
1920import { ensureServerRunning } from "./serverLauncher" ;
2021import serverRegistry from "./serverRegistry" ;
@@ -393,37 +394,39 @@ export class LspClientManager {
393394 const showParams = params as ShowMessageParams ;
394395 if ( ! showParams ?. message ) return false ;
395396 const { type, message } = showParams ;
396- let statusType : "info" | "success" | "warning" | "error" = "info" ;
397- let icon = "info" ;
398- let duration : number | false = 5000 ;
397+ const serverLabel = server . label || server . id ;
398+
399+ // Helper to clean and truncate message for notifications
400+ const cleanMessage = ( msg : string , maxLen = 150 ) : string => {
401+ // Take only first line
402+ let cleaned = msg . split ( "\n" ) [ 0 ] . trim ( ) ;
403+ if ( cleaned . length > maxLen ) {
404+ cleaned = cleaned . slice ( 0 , maxLen - 3 ) + "..." ;
405+ }
406+ return cleaned ;
407+ } ;
399408
400- switch ( type ) {
401- case 1 : // Error
402- statusType = "error" ;
403- icon = "error" ;
404- duration = false ; // Persistent for errors
405- break ;
406- case 2 : // Warning
407- statusType = "warning" ;
408- icon = "warningreport_problem" ;
409- duration = 8000 ;
410- break ;
411- case 3 : // Info
412- statusType = "info" ;
413- icon = "info" ;
414- break ;
415- case 4 : // Log
416- statusType = "info" ;
417- icon = "autorenew" ;
418- break ;
409+ // Use notifications for errors and warnings
410+ if ( type === 1 || type === 2 ) {
411+ const notificationManager = new NotificationManager ( ) ;
412+ notificationManager . pushNotification ( {
413+ title : serverLabel ,
414+ message : cleanMessage ( message ) ,
415+ icon : type === 1 ? "error" : "warningreport_problem" ,
416+ type : type === 1 ? "error" : "warning" ,
417+ } ) ;
418+ // Log full message to console for debugging
419+ console . info ( `[LSP:${ server . id } ] ${ message } ` ) ;
420+ return true ;
419421 }
420422
423+ // For info/log messages, use status bar briefly
421424 lspStatusBar . show ( {
422- message,
423- title : server . label || server . id ,
424- type : statusType ,
425- icon,
426- duration,
425+ message : cleanMessage ( message , 80 ) ,
426+ title : serverLabel ,
427+ type : "info" ,
428+ icon : type === 4 ? "autorenew" : "info" ,
429+ duration : 5000 ,
427430 } ) ;
428431 console . info ( `[LSP:${ server . id } ] ${ message } ` ) ;
429432 return true ;
@@ -441,14 +444,17 @@ export class LspClientManager {
441444 }
442445 const progressParams = params as ProgressParams ;
443446 if ( ! progressParams ?. value ) return false ;
444- console . log ( "Progress" , progressParams . value ) ;
445447
446448 const { kind, title, message, percentage } = progressParams . value ;
447449 const displayTitle = title || server . label || server . id ;
450+ // Use server ID + token as unique status ID for concurrent progress tracking
451+ const progressToken = progressParams . token ;
452+ const statusId = `${ server . id } -progress-${ progressToken ?? "default" } ` ;
448453
449454 if ( kind === "begin" ) {
450455 lspStatusBar . show ( {
451- message : message || "Starting..." ,
456+ id : statusId ,
457+ message : message || title || "Starting..." ,
452458 title : displayTitle ,
453459 type : "info" ,
454460 icon : "autorenew" ,
@@ -458,17 +464,13 @@ export class LspClientManager {
458464 } ) ;
459465 } else if ( kind === "report" ) {
460466 lspStatusBar . update ( {
467+ id : statusId ,
461468 message : message ,
462469 progress : percentage ,
463470 } ) ;
464471 } else if ( kind === "end" ) {
465- lspStatusBar . show ( {
466- message : message || "Complete" ,
467- title : displayTitle ,
468- type : "success" ,
469- icon : "check" ,
470- duration : 2000 ,
471- } ) ;
472+ // Just hide the progress item silently, no "Complete" message
473+ lspStatusBar . hideById ( statusId ) ;
472474 }
473475
474476 console . info (
@@ -510,6 +512,7 @@ export class LspClientManager {
510512 client . connect ( transportHandle . transport ) ;
511513 await client . initializing ;
512514 if ( ! client . __acodeLoggedInfo ) {
515+ // Log root URI info to console
513516 if ( normalizedRootUri ) {
514517 if ( originalRootUri && originalRootUri !== normalizedRootUri ) {
515518 console . info (
@@ -521,6 +524,7 @@ export class LspClientManager {
521524 } else if ( originalRootUri ) {
522525 console . info ( `[LSP:${ server . id } ] root ignored` , originalRootUri ) ;
523526 }
527+ console . info ( `[LSP:${ server . id } ] initialized` ) ;
524528 client . __acodeLoggedInfo = true ;
525529 }
526530 } catch ( error ) {
0 commit comments