91 Commits
Author SHA1 Message Date
Bartek Pacia c428c57839 cleanup [lsp]: fix all "Legacy Long overload can be converted to Duration" warnings (ConvertLongToDuration)
GitOrigin-RevId: 0229dae6eae604ec15e93844066c1edcb325bda6
2026-02-11 12:39:16 +00:00
Titouan Bion cd792c9f20 [fleet] [FL-34378] Remove third party specific implementations from the Fleet Gradle Plugin SDK
Third-party plugin development is deprecated, we remove everything redundant for a monorepo-only usage of the SDK:
- Support for non-local plugin dependencies is removed (Marketplace resolution)
- Dock resolution by version is removed
- Gradle integration for sources of non-Gradle friendly jars is removed (Ivy repositories)
- Convenient vendor resolution from Marketplace is removed
- Support for odd/different plugin project layouts is removed

GitOrigin-RevId: 27cbdeb81cdebc1760825c0d1fb797af1a549729
2026-02-05 10:58:05 +00:00
Leonid Shalupov c8cba92f81 IJI-3282 Optimize imports (2)
GitOrigin-RevId: a9977be5b80a96b658299f0385bbc6eb87621d17
2026-02-05 09:01:00 +00:00
Ludwig Valda Vasquez 96728011dc refactor [lsp]: add tests for the read line func
GitOrigin-RevId: 153cdd1c4f05c31292946809514890384a89ec53
2026-02-03 01:26:50 +00:00
Ludwig Valda Vasquez b212bdd7ac [air] lsp: add file system watcher impl
LSP allows the client to provide a filesystem watcher to the server, to
simplify server's implementation and to remove duplication of work,
since clients often require such watchers anyway.

Air's implementation is based on the FSD's WatchApi. This means there
are some differences to the VS Code watchers, for example, our
implementation will never emit "Created" event, because this isn't
exposed in the WatchApi. Conversely, WatchApi may emit a "Rescan" event
which doesn't have an appropriate equivalent in the VS Code (hence, LSP)
watcher interface.

Other than that, the implementation tries to follow the VS Code
behaviour in most cases (e.g. using recursive watchers if pattern
contains "**" or "/" and non-recursive otherwise), so the
recommendations on the use of the LSP watcher API are roughly the same
as for VS Code.

Space-RevId: 1ad774f7425f86e11aab4e64e62e96453bfc864a

GitOrigin-RevId: 5a1abadc8f18deb06b71625ab2add0f0b6f030a7
2026-02-03 01:26:50 +00:00
Leonid Shalupov 188b7ef96f IJI-3282 Optimize imports
GitOrigin-RevId: 3b5c00d8ff20b8d0bb6005bc450921085d2da9b2
2026-01-31 17:03:42 +00:00
Bartek Pacia a35a04ac59 cleanup [lsp]: rename notification constants for clarity and update usages
GitOrigin-RevId: 5c655c1b820e0fe872ce724c0d8341ce15ff6186
2026-01-30 22:15:03 +00:00
Bartek Pacia 7918d0998b docs [lsp]: link to LSP spec from LogMessage.kt
also reformat the whole file.

GitOrigin-RevId: 96774fd46b27e7db853553f24c4788cfdc563060
2026-01-30 22:15:03 +00:00
Bartek Pacia ab90c85392 docs [lsp]: link to LSP spec from LogTrace.kt
also refromat the file

GitOrigin-RevId: fc98f95db70992e9f1bb74dca560ccb09f5a8e0b
2026-01-30 22:15:03 +00:00
Georgii Ustinov c3792d2b39 [Java] LSP-425 Introduce variable non-interactive implementation
GitOrigin-RevId: 6eeeeff0a6d23ae886aafbb8fe0d5288115ab009
2026-01-26 10:29:01 +00:00
Bartek Pacia 097b1566e3 cleanup [lsp]: optimize imports in protocolFraming.kt
GitOrigin-RevId: 47adee4c18cd8fe89486542a92d2559e0e4087e2
2026-01-19 23:36:15 +00:00
Mikhail Filippov ea41f7932a [build] IJI-2993 enable progressive mode for Kotlin
GitOrigin-RevId: f506021c20fc3b3e5ef692c9092592e3bf247036
2026-01-14 11:00:39 +00:00
Bartek Pacia cc779a4a76 LSP-336 enable go-to-implementation for Java
GitOrigin-RevId: 7ad706e24d8634b235e6d5f1836b0f2aa5eb9835
2026-01-13 11:04:58 +00:00
Andrey Zaytsev d3b1beaa8f LSP-365 [analyzer] Kotlin completion stops working with "Your completion session has expired"
Caffeine cache does not guarantee recent items being available. Store latest completion session as is in db instead.

GitOrigin-RevId: b0c942db8d2737469ed957b901dc810570d6cef6
2026-01-08 19:57:33 +00:00
Andrey Zaytsev c6bf4b505e LSP-370 [analyzer] Java completion sorting
GitOrigin-RevId: ee9fbec91e1af9a9e5d1b49c077ecf03051da010
2026-01-08 18:47:47 +00:00
Mikhail Filippov 7744eca84a [build] IJPL-220367 bump Kotlin language and API versions
GitOrigin-RevId: c58c2f2ca3e4fbbe5116bd19119345174b7db32f
2025-12-20 13:35:48 +00:00
Ludwig Valda Vasquez 423117f8d7 [air] lsp: improve server logging situation
We now have two dedicated loggers to handle logs sent by the server to
the client.

fleet.workspace.lsp.LSPServer logger is for general logging that a
server may wish to perform. Incoming log messages will be mapped to our
own log levels (ERROR, WARN, DEBUG, etc.) and only printed if the logger
config is set to print messages at that level.

fleet.workspace.lsp.LSPServerTrace logger is for tracing. The LSP
specification identifies these two types of logging as distinct, making
this logger specifically for debugging purposes.

The f.w.l.LSPServer logger's source is "window/logMessage"
notifications, as for f.w.l.LSPServerTrace, it receives the log entries
with the "$/logTrace" notification.

GitOrigin-RevId: 41c038424ae15a22725b8d7c2c738bbaf0c953df
2025-12-18 21:46:43 +00:00
Bartek Pacia f24582201d LSP-334 enable Java type hierarchy (subtypes + supertypes)
GitOrigin-RevId: a1c29d9d897915fcd04017d8648166ffa9bd33e5
2025-12-18 17:24:08 +00:00
Nikolay Rykunov f611a55f38 [dap] LSP-335: Provide lsp server coroutine scope to the command handler
GitOrigin-RevId: d6e066b306414b9c16b19a306e55f00cca969419
2025-12-17 21:26:45 +00:00
Ludwig Valda Vasquez f386554c29 LSP-306 [lsp] fix line reader
When implementing readUTF8Line, it wasn't taken into account that the
`readBuffer` getter is not guaranteed to return the exact same buffer
state between accesses, even if `awaitContent` wasn't called.

The specific implementation of ByteChannel from ktor tried to fill the
buffer on access whenever it happens to be exhausted and some data was
available in the "flush" buffer.

This could lead to more data being read in the line reader loop than
expected, resulting in an invalid payload and broken framing in the LSP
protocol framing.

Now we read sequentially byte after byte. The new implementation is an
almost verbatim copy of the readUTF8LineTo method from the ktor utils.

GitOrigin-RevId: fe0cd982e94be15c6281462aa9c360d7472512dd
2025-12-15 04:47:31 +00:00
Andrey Zaytsev 8676996feb cleanup [lsp]: remove redundant Middleware concept
GitOrigin-RevId: da4163f55cbe0c618fec4a733b102db776eaedf1
2025-12-14 16:02:54 +00:00
Gregory.Shrago f4b1bc094f cleanup [lsp]: drop unused dangerous method
GitOrigin-RevId: d1ee18c3772331bc4d51843a9fbd04c263a2968c
2025-12-08 18:24:26 +00:00
Andrey Zaytsev d3951ff7c4 LSP-306 [lsp] add some diagnostics
GitOrigin-RevId: d1aa5b3cd4a6ad5e8ae842cd3d83a35bb558c373
2025-12-05 16:42:50 +00:00
Rustam Sadykov 0fdda0a8a0 [aiir, lsp] add folding range request
GitOrigin-RevId: 40ad30f2a30e3f2b197ba4ec4d038020e93758f6
2025-12-04 18:06:13 +00:00
Bartek Pacia f19e78eb73 refactor [lsp]: add descriptive CoroutineNames to launched coroutines
GitOrigin-RevId: c9aa7d304bca249bd503704b99b947cbf1829147
2025-12-04 00:08:32 +00:00
Bartek Pacia 4b2688f440 [lsp] doc Diagnostics with links to LSP
GitOrigin-RevId: 088dd2b3640313cdfc74d2e4ad7b339060e0e324
2025-12-02 18:04:05 +00:00
Bartek Pacia 399f0762d0 [lsp] doc CodeAction and ExecuteCommand with links to LSP
GitOrigin-RevId: 21ddbb309d2b45c283a72312746844dfe91fb601
2025-12-01 17:10:11 +00:00
Ludwig Valda Vasquez b2422c8faf [air] lsp: make features dynamic
Most of the used conditional features (i.e. the features that require a
capability check) are now implemented as dynamic features, meaning they
can be registered through the `registerCapability` request while the
client is running.

The capability check is replaced by a feature registration check
instead.

GitOrigin-RevId: 0601feb9f5f14c58a8b30c66bae65940e53166c6
2025-11-27 18:42:24 +00:00
Ludwig Valda Vasquez b642501dc3 refactor [lsp]: implement custom serialisers for OrBoolean and OrString
Until now they were carrying a JsonElement and required passing a
serialiser on every use, which was slightly inconvenient.

GitOrigin-RevId: 603744e8a22573e56b0f16502e926ba0c9d8e5f1
2025-11-27 18:42:24 +00:00
Bartek Pacia d49c348c01 [lsp] doc ExecuteCommand.kt with links to LSP spec
GitOrigin-RevId: 5fd426cea59e55f8e68c2e166c6c3d86db69460e
2025-11-26 18:58:30 +00:00
Sergei Sysoev 928286613b [fleet] add ios target to modules (DOES NOT COMPILE)
This commit contains only regenerated build.gradle.kts files after adding all required modules to ios target. Since it doesn't contain the actuals for ios, fleet won't compile from this revision

GitOrigin-RevId: aed8a8ef07578abb984bc79f3cbf1b6755196520
2025-11-25 05:14:19 +00:00
Bartek Pacia 2e549d038d [lsp] doc Diagnostics with links to LSP spec
GitOrigin-RevId: 7285add3b87c30de09266abe1a14ac7dbde13e8f
2025-11-22 00:43:24 +00:00
Bartek Pacia a6e2869257 [lsp] doc CodeAction with links to LSP spec
GitOrigin-RevId: 061fc3d745946b64abee57ef24600355c51a6a58
2025-11-22 00:43:24 +00:00
Ludwig Valda Vasquez 24604882cb refactor [lsp]: remove ktor dependency from lsp.protocol
The `lsp.protocol` module now doesn't depend on ktor.

All code that was depending on it was pushed in the module users.

GitOrigin-RevId: f065946f470ab9d13c457a0623267c2cb55dd0e5
2025-11-20 16:02:36 +00:00
Ludwig Valda Vasquez 9040721730 refactor [lsp]: abstract over i/o to remove ktor dependency
We want to remove ktor dependency from the lsp.protocol module as it
conflicts with other uses.

The module has a single usage of ktor, its i/o utils types:
ByteReadChannel and ByteWriteChannel.

These are now replaced by requivalent interfaces. In this patch, ktor
dependency is still present and implements the aforementioned interfaces
in this same module, but the goal is to move the implementation into
module consumers.

GitOrigin-RevId: 62681cd01c54b00cab7e17682fe6858db01d4186
2025-11-20 16:02:36 +00:00
Gregory.Shrago 78a459ba84 [lsp] Use exp backoff and timeout in tcpClient
GitOrigin-RevId: feea38953036b38b0683ecd8ef027adec53ce953
2025-11-19 19:02:31 +00:00
Alexander Zolotov bd4dda9d70 [fleet] replace getOrPut methods with concurrency-ready alternative
GitOrigin-RevId: 33d5641fe1a2f11e5563b7a63f23bfb8e89957f0
2025-11-09 09:48:48 +00:00
Alexander Zolotov 44816cafd8 [fleet] rename multiplatform ConcurrentHashMap
Renaming will prevent misuse of multiplatform collection in non-fleet projects.

GitOrigin-RevId: 50e78f7240be32ef71207a7ae50e4aa485f217ac
2025-11-08 18:46:14 +00:00
Ludwig Valda Vasquez 8ca4e2c3d7 [analyzer] fix initialisation progress reporting
Progress reporting during initialisation has a time-based debounce: the
sending coroutine (working concurrently with the passed-in block) is
waiting 100ms after sending a progress update, before proceeding with
the next update.

When the block returns, the sending coroutine is immediately cancelled,
robbing it of a chance to wake up and deliver the end progress message,
that the block requests at the very end. This caused the never-ending
progress displaying in Air.

The "withProgress" function has been fixed to always send begin/end
message out of bound and only debounce intermediate progress updates.
Since the end message may be a subject for customisation, depending on
the execution path taken, to enforce the begin/end contract on progress,
the signature was updated: the function now takes the begin progress
title, and the block is now required to return "WorkDoneProgress.End"
instance that will be sent to the client.

To keep the code simple, the function no longer returns a generic T. It
can be added back, if necessary, however, currently it only has one
usage that expects Unit.

GitOrigin-RevId: ea8b390cb7bca4c894c5c2b75e304b71eaf03481
2025-11-07 05:12:05 +00:00
Andrey Zaytsev 740131f499 [analyzer] fix compilation
GitOrigin-RevId: 42681fa95197b04facada653617e350ef45a44a4
2025-10-30 03:19:54 +00:00
Andrey Zaytsev 5dc7067bd2 [analyzer] refactor: extract progress to a file
GitOrigin-RevId: 78d779182d536b6f632ce4763ebff631ee2096d5
2025-10-30 03:19:54 +00:00
Andrey Zaytsev 584e4094bd [analyzer] bug: rogue cancellation thrown from lsp request of notification handler could destroy the entire server or client
GitOrigin-RevId: 27528e5e0345bd5b3a702fa734c0c597dff8787e
2025-10-30 03:19:54 +00:00
Andrey Zaytsev 530faa43ef [analyzer] refactor: apply back pressure to LspClient, making notify suspending
GitOrigin-RevId: f56a92db1b9f21d283ed7460902969babe6a326c
2025-10-30 03:19:54 +00:00
Ludwig Valda Vasquez 734478621b [air] lsp: dynamic capability registration
This patchset adds dynamic capability registration.

Dynamic capabilities are implemented in a form of dynamic features, by
conforming to the `DynamicFeature` interface (and its corresponding
`Descriptor`).

Symmetrically, one can create "static" features by conforming to the
`StaticFeature` interface. This is mostly mimicking the vscode model.

As an example, two features were implemented:
`LSPPublishDiagnosticFeature` which is a "static" feature, and
`LSPDiagnosticFeature`, which is an example of a "dynamic" feature.

Dynamic features can be "activated" by registering them. The
registration can happen upon server initialisation, if the server
responds to the initialised request with registration data in its
capabilities. If not, the server may later invoke the
`"registerCapability"` method to register a dynamic feature.

Dynamic features can be later "deactivated" if the server invokes the
`"unregisterCapability"` method with the corresponding registration id.

This is the starting point for converting more features to allow their
dynamic registration, which is a requirement for some servers.

GitOrigin-RevId: 5ad44219ed08546ab200d7b210d8176c5d45bf8b
2025-10-30 02:46:14 +00:00
Sergei Sysoev f60891c1bf [fleet] update kotlinx.coroutines
GitOrigin-RevId: cc2fc10b036bb4a3199edf1c7b12fbe9423d0e03
2025-10-23 01:08:40 +00:00
pavel.mikhailovskii 3654dd4d43 [lsp] LSP-234 migrate inspections, intentions and Kotlin compiler quickfixes to mod commands
GitOrigin-RevId: 9603e99658bf8dd17f76365aab8d2911f22b2d05
2025-10-16 21:15:05 +00:00
Ludwig Valda Vasquez e38c0dfd62 [air] lsp: add pull diagnostics, fix other pulls
We'd only pull markup (such as inlay hints, code lenses, etc.) in
response to the "workspace/*/refresh" notifications, which is what
rust-analyzer sends on every document change, but that's not how it is
supposed to work. By the spec, those notifications should occur whenever
a project-wide change was detected by the server that may have affected
all documents' markup.

The expected behaviour is that the client (Air) requests the changes for
all the markup whenever it thinks it's convenient and warranted. This
translates into requests on any document change.

It wasn't necessary with rust-analyzer, since the original way worked,
but we didn't get any live updates to inlay hints and others when using
different language servers, such as typescript LSP server.

In addition, a dignostic pull was added with the same kind of trigger
(on every document change). This is necessary to support kotlin LSP,
which doesn't ever send textDocument/publishDiagnostic notification.

GitOrigin-RevId: 5df5c2981336fe0fba1cb5e04c6883deef2e9bd6
2025-10-07 19:45:53 +00:00
Titouan Bion c019589d3e [fleet] Regenerate build.gradle.kts
GitOrigin-RevId: 58b102a6d63fe767d1eb749359e5fa1dcdd12d6c
2025-09-29 19:13:30 +00:00
Andrey Zaytsev 7bab964a87 [fleet, analyzer] avoid reflection on getting serializers
GitOrigin-RevId: 80fc1d5431fa989db0816f5cc1266fdc08cf8a8b
2025-09-22 17:06:16 +00:00
Alexander Zolotov b12f1c1a8a [fleet, build] update convention naming for test directories
testCommonTest -> srcCommonTest
testJvmTest -> srcJvmTest
etc.

# Conflicts:
#	fleet/plugins/devkit/workspace/gradlebuild/build.gradle.kts
#	fleet/plugins/java/workspace/gradlebuild/build.gradle.kts
#	fleet/plugins/kotlin/workspace/gradlebuild/build.gradle.kts
#	fleet/plugins/webpack/common/gradlebuild/build.gradle.kts
#	fleet/plugins/webpack/protocol/gradlebuild/build.gradle.kts
#	fleet/plugins/webpack/test/gradlebuild/build.gradle.kts
#	fleet/plugins/webpack/workspace/gradlebuild/build.gradle.kts

# Conflicts:
#	fleet/plugins/log/frontend/gradlebuild/build.gradle.kts
#	fleet/plugins/run/mcp/workspace/gradlebuild/build.gradle.kts
#	fleet/plugins/webpack/frontend/gradlebuild/build.gradle.kts

GitOrigin-RevId: 3adabab65353bcdd596792a6ea5cefcff2d6dd07
2025-09-22 10:52:10 +00:00