Skip to content

Fix organize imports crash with traceResolution#3289

Merged
gabritto merged 4 commits intomicrosoft:mainfrom
Andarist:fix/organize-imports-trace-resolution
Apr 15, 2026
Merged

Fix organize imports crash with traceResolution#3289
gabritto merged 4 commits intomicrosoft:mainfrom
Andarist:fix/organize-imports-trace-resolution

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

fixes a crash found here #3281 (comment)

Comment thread internal/project/compilerhost.go Outdated
Comment thread internal/project/compilerhost.go Outdated
// Trace implements compiler.CompilerHost.
func (c *compilerHost) Trace(msg *diagnostics.Message, args ...any) {
panic("unimplemented")
if logger := c.logger.Verbose(); logger != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need to check Verbose() here, since we're only going to call this with args if traceResolution is set anyway. Though maybe we need to check for len(args) to avoid printing a log message with empty content.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped the verbosity check now. I don't think it's worth checking the args anyhow. The msg itself doesn't have to support any args - and if this ends up pringint an empty log message then I think the bug would be elsewhere anyway

@gabritto gabritto added this pull request to the merge queue Apr 15, 2026
Merged via the queue into microsoft:main with commit 707db30 Apr 15, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants