Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol not indexed #1896

Closed
MahdiBM opened this issue Dec 21, 2024 · 3 comments
Closed

Symbol not indexed #1896

MahdiBM opened this issue Dec 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@MahdiBM
Copy link
Contributor

MahdiBM commented Dec 21, 2024

Swift version

6.0.3

Platform

macOS

Editor

VSCode / Cursor

Description

Debug logs for Jump To Definition of AuditLog.Entry symbol:

2024-12-21 14:50:39.289079 0330 0x69e682   Signpost    0x0                  10043  0    [spid 0x125, process, begin] sourcekit-lsp: [org.swift.sourcekit-lsp:message-handling] Request: <private>
2024-12-21 14:50:39.289168 0330 0x69fa9f   Signpost    0x0                  10043  0    [spid 0x125, process, event] sourcekit-lsp: [org.swift.sourcekit-lsp:message-handling] Start handling
2024-12-21 14:50:39.289236 0330 0x69fa9f   Default     0x0                  10043  0    sourcekit-lsp: [org.swift.sourcekit-lsp:request-73] Received request <private>: textDocument/definition
2024-12-21 14:50:39.292606 0330 0x69e682   Info        0x0                  10043  0    sourcekit-lsp: [org.swift.sourcekit-lsp:request-73] Sending sourcekitd request:
<112 lines>
2024-12-21 14:50:39.358989 0330 0x69faa0   Debug       0x0                  10043  0    sourcekit-lsp: [org.swift.sourcekit-lsp:request-73] Received sourcekitd response:
<2 lines>
2024-12-21 14:50:39.359158 0330 0x69faa0   Info        0x0                  10043  0    sourcekit-lsp: [org.swift.sourcekit-lsp:request-73] Fallback definition request: 1: MD5 digest: 89b15643aaeb651a0e46ca0673598a16
2024-12-21 14:50:39.359190 0330 0x69faa0   Signpost    0x0                  10043  0    [spid 0x125, process,   end] sourcekit-lsp: [org.swift.sourcekit-lsp:message-handling] Request: Done
2024-12-21 14:50:39.359210 0330 0x69e680   Default     0x0                  10043  0    sourcekit-lsp: [org.swift.sourcekit-lsp:request-73] Succeeded (took 69.977999ms)
textDocument/definition
Optional<LocationsOrLocationLinksResponse>

Looks like it succeeded but the response wasn't helpful?

Steps to Reproduce

Clone Penny and open /Sources/Penny/Handlers/AuditLogHandler.swift.
Observe that jump-to-definition doesn't work for this symbol:

Screenshot 2024-12-21 at 2 42 35 PM

Worth noting:

  • That symbol is in DiscordModels.
  • DiscordModels is @_exported by the DiscordBM umbrella module.
  • DiscordBM is imported in the file (the exact needed modules are DiscordModels and DiscordUtilities).
  • Still couldn't find a relation between @_exported and the behavior.
    • Tried directly importing the modules, still no luck even after reloading the window etc... .

Logging

No response

@MahdiBM MahdiBM added the bug Something isn't working label Dec 21, 2024
@MahdiBM
Copy link
Contributor Author

MahdiBM commented Dec 21, 2024

@ahoppen sorry for the constant pings but this one is more annoying than the other issues I've filed here or in the VSCode extension repo, so just wanted to mention it.
Couldn't even get autocomplete for event.action which is an enum. Eventually opened GitHub and searched the symbol there (preferred this over searching in .build).

I have little knowledge about how the indexing works so not sure if there are docs or something or ... basically I'm not sure how easy / hard it'll be for me to debug this.
Though haven't taken a look yet, so can't tell.

@ahoppen
Copy link
Member

ahoppen commented Dec 21, 2024

Synced to Apple’s issue tracker as rdar://141869009

@ahoppen
Copy link
Member

ahoppen commented Jan 8, 2025

Looking at the logs with extended logging enabled, I see that we’re failing to build SotoCore with the following error (seeing the same error when building penny-bot using a recent Swift development snapshot) and we don’t continue because you have "backgroundPreparationMode": "build" in your config.json. Could you check if removing that setting fixes the issue? I couldn’t reproduce it anymore after removing the setting. If it doesn’t, please re-open the issue.

/private/tmp/penny-bot/.build/index-build/checkouts/soto-core/Sources/SotoCore/Encoder/CodableProperties/DateCoders.swift:112:23: error: static property 'dateFormatter' is not concurrency-safe because non-'Sendable' type 'DateFormatter' may have shared mutable state
110 | public struct HTTPHeaderDateCoder: DateFormatCoder {
111 |     public static let format = "EEE, d MMM yyy HH:mm:ss z"
112 |     public static let dateFormatter = createDateFormatter()
    |                       |- error: static property 'dateFormatter' is not concurrency-safe because non-'Sendable' type 'DateFormatter' may have shared mutable state
    |                       |- note: add '@MainActor' to make static property 'dateFormatter' part of global actor 'MainActor'
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
113 | }
114 | 

@ahoppen ahoppen closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants