@@ -389,7 +389,7 @@ func (c *Client) openKeyConfigFiles(ctx context.Context) {
389 filepath.Join(workDir, "package.json"),
389 filepath.Join(workDir, "package.json"),
390 filepath.Join(workDir, "jsconfig.json"),
390 filepath.Join(workDir, "jsconfig.json"),
393 // Also find and open a few TypeScript files to help the server initialize
393 // Also find and open a few TypeScript files to help the server initialize
394 c.openTypeScriptFiles(ctx, workDir)
394 c.openTypeScriptFiles(ctx, workDir)
395 case ServerTypeGo:
395 case ServerTypeGo:
@@ -547,12 +547,12 @@ func (c *Client) openTypeScriptFiles(ctx context.Context, workDir string) {
547// shouldSkipDir returns true if the directory should be skipped during file search
547// shouldSkipDir returns true if the directory should be skipped during file search
548func shouldSkipDir(path string) bool {
548func shouldSkipDir(path string) bool {
549 dirName := filepath.Base(path)
549 dirName := filepath.Base(path)
551 // Skip hidden directories
551 // Skip hidden directories
552 if strings.HasPrefix(dirName, ".") {
552 if strings.HasPrefix(dirName, ".") {
553 return true
553 return true
556 // Skip common directories that won't contain relevant source files
556 // Skip common directories that won't contain relevant source files
557 skipDirs := map[string]bool{
557 skipDirs := map[string]bool{
558 "node_modules": true,
558 "node_modules": true,
@@ -562,7 +562,7 @@ func shouldSkipDir(path string) bool {
562 "vendor": true,
562 "vendor": true,
563 "target": true,
563 "target": true,
566 return skipDirs[dirName]
566 return skipDirs[dirName]
@@ -776,3 +776,10 @@ func (c *Client) GetDiagnosticsForFile(ctx context.Context, filepath string) ([]
777 return diagnostics, nil
777 return diagnostics, nil
780+// ClearDiagnosticsForURI removes diagnostics for a specific URI from the cache
781+func (c *Client) ClearDiagnosticsForURI(uri protocol.DocumentUri) {
782+ c.diagnosticsMu.Lock()
783+ defer c.diagnosticsMu.Unlock()
784+ delete(c.diagnostics, uri)