-
Notifications
You must be signed in to change notification settings - Fork 105
textDocumentSync coming back as 0/None #162
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
Comments
@tom-bowles sounds like there are two issues. Issue 1
Issue 2Currently cake doesn't support incremental changes, so we only have one choice we can make, which is to force full text changes, this is because the Now the complication comes in when the client supports Dynamic Registration. If dynamic registration is supported, then we return |
For the first issue, I've simply changed the implementation to look for For the second issue with the first fixed, if synchronization is not dynamic, it should fall into the correct code path and return the proper values. see #163 |
Wow, awesomely quick - thanks! I'll give this a try in the morning. |
Well keep in mind we still have to update OmniSharp roslyn and stuff, unless you have a fork locally for your testing. |
I do! However, I get:
|
Changes for #162 correct how text document sync settings are configured
I think we did finally get this merged, let us know if it's still an issue. |
OmniSharp still sends For reference, here's a log from the SublimeText LSP plugin:
I'm starting OmniSharp in a straightforward way. This is SublimeText-specific, but for reference here's my setup:
|
I believe omnisharp-roslyn was not updated to the latest csharp-language-server-protocol itself. I tried to do a PR to fix that, but some things are clearly not working for now (CI fails). Maybe @david-driscoll could take a look.. |
When using OmniSharp LSP from emacs lsp-mode, the initialize handshake is as shown at the bottom. The server response contains
"textDocumentSync": 0
, so lsp-mode sends no textDocument/didChange notifications.The relevant code in
LanguageServer.cs
is also shown below. The check forccp.HasStaticHandler(textDocumentCapabilities.Synchronization)
returns false because although there is aTextDocumentSyncHandler
registered (specificallyOmnisharpTextDocumentSyncHandler
),TextDocumentSyncHandler
doesn't provideIWillSaveTextDocumentHandler
orIWillSaveWaitUntilTextDocumentHandler
, both of which are linked toSynchronizationCapability
.Removing the check causes the server to return a textDocumentSync options block, but the
change
item is set to 1 (full) rather than 2 (incremental). This appears to be because there are two OmnisharpTextDocumentSyncHandlers registered, one for cake and one for cs/csx, and the cake one doesn't handle incremental. Not sure if that should be a separate issue for omnisharp-roslyn, but it means you can't send incremental changes for cs/csx files because the Min() call in the code below means it picks up kind 1.The text was updated successfully, but these errors were encountered: