@@ -107,7 +107,7 @@ func (api *API) HandleRequest(ctx context.Context, method string, payload []byte
107107 }))
108108 case MethodGetDiagnostics :
109109 params := params .(* GetDiagnosticsParams )
110- return encodeJSON ((api .GetDiagnostics (ctx , params .Project )))
110+ return encodeJSON ((api .GetDiagnostics (ctx , params .Project , params . FileNames )))
111111 default :
112112 return nil , fmt .Errorf ("unhandled API method %q" , method )
113113 }
@@ -265,7 +265,7 @@ func (api *API) GetSourceFile(projectId Handle[project.Project], fileName string
265265 return sourceFile , nil
266266}
267267
268- func (api * API ) GetDiagnostics (ctx context.Context , projectId Handle [project.Project ]) ([]* ls.Diagnostic , error ) {
268+ func (api * API ) GetDiagnostics (ctx context.Context , projectId Handle [project.Project ], fileNames [] string ) ([]* ls.Diagnostic , error ) {
269269 projectPath , ok := api .projects [projectId ]
270270 if ! ok {
271271 return nil , errors .New ("project ID not found" )
@@ -278,7 +278,7 @@ func (api *API) GetDiagnostics(ctx context.Context, projectId Handle[project.Pro
278278 }
279279
280280 languageService := ls .NewLanguageService (project .GetProgram (), snapshot )
281- diagnostics := languageService .GetDiagnostics (ctx )
281+ diagnostics := languageService .GetDiagnostics (ctx , fileNames )
282282
283283 api .symbolsMu .Lock ()
284284 defer api .symbolsMu .Unlock ()
0 commit comments