Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lsp4e-dev] LSP4e document corruption
  • From: Thomas Gibson-Robinson <tom@xxxxxxxxxx>
  • Date: Thu, 17 Mar 2022 13:20:59 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cocotec.io; dmarc=pass action=none header.from=cocotec.io; dkim=pass header.d=cocotec.io; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eeOGKybrMhwKHFuIh4pX7Pc0kfs6nTndaqlDVDGl+eA=; b=KJqnHH62ttNYul6PsJ0OWfTG3auZo+gH3tEp3ohhKgcSYMIbh302B/anSBWKpP1GHzZjKl+QLob9RPliZwL1dJRsvbnARzKoCSsXgBGOxsSXyOvUfnK2py2DRApsSYuwjSxyE/W/7k5vtsalVGEapTK3VaNj+K9tNt9mwxtW/tryT/rvC9Lp5eE1eaJoglNvHdiHe93agSWiql9n+LlwbxU+tHb+uBXkonvlQoMwQOt352uvgcpkbx9uPINfihcCfgNOgNjdDVQFnshtoqc7XWjmlMDfVeSX8FOFXlSbRn76zJ3fo6wbgbvjqb4eJ2P5s+GKIdSOdLcUy8LLNK2bsw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hC3i+HtLE5M6ePir3h4YxDvq0vp9sfmnlqZijlJjGQfJz/YK9II/VGTiHwAN9tavNxtE9ciJLXoZeyv2vLg293ygsZpxO04T657a5OWovYxB7GReB5T28lrHNT0690Is/sLbKGnDKe3A8EKYhVzivr3UgUv1+TAjPOpBaOcNH9cgbgdAqbjZsMknjBbOVzNVQuDigXDj6iFv3gcVq/1c9p+84rhlATfnpOFIffLCsxW2A5GbCLI0LCak/krXuX/kQGs3vaVDtGPYl+z0qB7sxn8KhNhwwpa13lo1pGfV1L2o7B2660HBcl4EZCpjvjv+op/y26b50lU7g2oJ9rCYew==
  • Delivered-to: lsp4e-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/lsp4e-dev/>
  • List-help: <mailto:lsp4e-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/lsp4e-dev>, <mailto:lsp4e-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/lsp4e-dev>, <mailto:lsp4e-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHYOfEKME6ivTaX3Ua9LXsEoKfyQ6zDi4UAgAAER4A=
  • Thread-topic: [lsp4e-dev] LSP4e document corruption

> On 17 Mar 2022, at 13:05, Mickael Istria <mistria@xxxxxxxxxx> wrote:
> 
> It's a genuine problem of LSP4E.
> However, I don't think you need a FIFO. You actually need to keep the last future that was created for a change and call something like `lastFuture = lastFuture.thenRun(ls -> ls.getTextDocumentService().didChange(changeParamsToSend));` to ensure the sequential invocations. Maybe even replace `languageServerWrapper.getInitializedServer()` by a method that takes care of returning the last change future.

That’s indeed exactly the kind of fix I was imagining. Whilst experimenting, I just added a variable lastChangeFuture on the DocumentContentSynchronizer and used thenApplyAsync to chain them together which seemed to resolve the problem.

Thanks for the comments. We’ll submit a patch along the above lines (I like your suggestion of a method on LanguageServerWrapper).

Tom


Back to the top