Skip to content

Commit

Permalink
lsp: update log messages for root dir note (#1395)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieegan3 authored Feb 10, 2025
1 parent 3e6ef5b commit 674e441
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/lsp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2251,18 +2251,22 @@ func (l *LanguageServer) handleInitialize(ctx context.Context, params types.Init
case len(configRoots) > 1:
l.logf(
log.LevelMessage,
"warning: multiple config roots found in workspace:\n%s\nusing %q as root",
"warning: multiple configuration root directories found in workspace:\n%s\nusing %q as workspace root directory",
strings.Join(configRoots, "\n"),
configRoots[0],
)

l.workspaceRootURI = uri.FromPath(l.clientIdentifier, configRoots[0])
case len(configRoots) == 1:
l.logf(log.LevelMessage, "using workspace directory %q as root", configRoots[0])
l.logf(log.LevelMessage, "using %q as workspace root directory", configRoots[0])

l.workspaceRootURI = uri.FromPath(l.clientIdentifier, configRoots[0])
default:
l.logf(log.LevelMessage, "using supplied root: %q, config may be inherited from parent directory", workspaceRootPath)
l.logf(
log.LevelMessage,
"using supplied workspace root directory: %q, config may be inherited from parent directory",
workspaceRootPath,
)
}

if l.clientIdentifier == clients.IdentifierGeneric {
Expand Down

0 comments on commit 674e441

Please # to comment.