Commit Graph

15 Commits

Author SHA1 Message Date
Rintaro Ishizaki a6c926fa34 Relax atomic memory orderings; switch semaphore to release/acquire
For ID counters and standalone flags (most sites), drop to .relaxed
since nothing reads other memory based on the atomic's value.

MultiEntrySemaphore.signaled is the exception: it is used as a
signal/wait primitive where waiters proceed to use state set up
before signal(). Use .releasing on store and .acquiring on load so
that pre-signal writes are visible to waiters that observe `true`.
.relaxed there would be incorrect on weakly-ordered architectures.
2026-05-21 11:16:17 -07:00
Rintaro Ishizaki 83de30d29f Migrate atomic call sites to Synchronization.Atomic and ThreadSafeBox
Replace AtomicBool/UInt8/UInt32/Int32 from
ToolsProtocolsSwiftExtensions with Synchronization.Atomic<T> where
the storage is a static, module-level let, or class stored property.
For local lets captured by @Sendable closures (where Atomic's
~Copyable nature prevents capture), use ThreadSafeBox<T> instead.
2026-05-21 10:58:34 -07:00
Rintaro Ishizaki a9566ac183 [LSPAny] Replace manual LSPAnyCodable impl with Codable-backed default
Remove hand-written `init?(fromLSPDictionary:)` / `encodeToLSPAny()`
from LSPAnyCodable types, relying instead on the default implementations
backed by `LSPAnyEncoder`/`LSPAnyDecoder`
2026-03-22 08:01:17 -07:00
Divya Prakash 0e8fb5fa21 Refactor keyword snippets: update tab stop order, use descriptive placeholders, and align switch cases 2025-12-19 15:43:47 +05:30
Divya Prakash 2abad47760 fix: resolve snippet issues 2025-12-18 21:49:24 +05:30
Divya Prakash dde3c8427e 2118: Implement keyword snippets for control-flow keywords 2025-12-10 20:42:39 +05:30
Anthony Latsis 6b19657739 Enable ExistentialAny 2025-12-02 12:27:27 +00:00
Mishal Shah 0876b7d403 Merge pull request #2324 from owenv/owenv/adopt-swift-tools-protocols
Adopt swift-tools-protocols
2025-11-05 09:02:00 -08:00
Owen Voorhees f04b971726 Adopt swift-tools-protocols 2025-10-31 14:11:11 -07:00
Alex Hoppen d9295b2c93 Add a closing parenthesis to function argument completions
Fixes #782
2025-10-30 14:38:33 +01:00
Alex Hoppen 37aafd35c0 Merge pull request #2287 from ahoppen/multi-line-completion-item-formatting 2025-09-10 09:43:29 +02:00
Alex Hoppen e43c808afd Format multi-line completion items returned by sourcekitd
For closures that don’t take any inputs and that don’t produce output, sourcekitd returns a completion item that has the trailing closure already expanded. Run SwiftBasicFormat on those to enure that the placeholder for the closure’s body is properly indented.

Fixes #2285
2025-09-09 14:47:10 +02:00
Ahmed Elrefaey 1982798b5d Fetch full documentation in code completion (#2207)
When resolving documentation for code completion items, we fetch full
documentation through the newly added
`swiftide_completion_item_get_doc_full_copy` SourceKitD function, if not
found we fallback to brief documentation as before using
`swiftide_completion_item_get_doc_brief`.

> [!NOTE]
> Unlike brief documentation, SourceKitD doesn't cache full
documentation for completion results to avoid bloating memory with a lot
of large strings.
>
> As of now, SourceKit-LSP doesn't cache completion item documentation
either, should we introduce a new full documentation cache (e.g. using
`LRUCache`)?
2025-09-04 19:42:37 +01:00
Pavel Yaskevich 28ec028ef5 [SwiftLanguageService] Adopt to throwing refactoring actions
`EditRefactoringProvider.textRefactor` and `EditRefactoringProvider.refactor`
requirements are now throwing and produce a non-optional type.
2025-08-22 23:27:39 -07:00
Alex Hoppen c14f5dd7fd Move SwiftLanguageService into its own module 2025-08-14 11:12:31 +02:00