Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Code completion is leading to validation execution in language server(Code completion is leading to validation execution in language server)
Code completion is leading to validation execution in language server [message #1856398] Thu, 08 December 2022 08:08 Go to next message
Eclipse UserFriend
Code completion is leading to validation execution in language server isn't bug ?

why we do execute validation when user request only code completion?


In LanguageServerImpl we do have method
public void didChange(DidChangeTextDocumentParams params) which will get triggered when we change resource in client , for IncrementalBuilder its always a new build request.



[Updated on: Thu, 08 December 2022 08:09] by Moderator

Re: Code completion is leading to validation execution in language server [message #1856399 is a reply to message #1856398] Thu, 08 December 2022 08:11 Go to previous messageGo to next message
Eclipse UserFriend
it would really help if you can give more context in your lsp questions if you expect to get an sufficient answer
can you provide a call stack where the vaidation is done
Re: Code completion is leading to validation execution in language server [message #1856402 is a reply to message #1856399] Thu, 08 December 2022 08:52 Go to previous messageGo to next message
Eclipse UserFriend
@Christian Dietrich Thank you for quick reply.

To answer your question
In IncrementalBuilder we have a method validate(Resource resource)

call stack : LanguageServerImpl[didChange->toBuildable]
WorkspaceManager[didChangeTextDocumentContent->didChangeFiles] ->BuildManager [submit-->internalBuild] IncrementalBuilder[launch]

I have attached debug call stack for reference.

does this information is sufficient?
  • Attachment: CallStack.JPG
    (Size: 110.29KB, Downloaded 113 times)

[Updated on: Thu, 08 December 2022 09:35] by Moderator

Re: Code completion is leading to validation execution in language server [message #1856405 is a reply to message #1856402] Thu, 08 December 2022 09:38 Go to previous messageGo to next message
Eclipse UserFriend
but where is content assist in this picture?

[Updated on: Thu, 08 December 2022 09:51] by Moderator

Re: Code completion is leading to validation execution in language server [message #1856407 is a reply to message #1856405] Thu, 08 December 2022 10:04 Go to previous messageGo to next message
Eclipse UserFriend
Christian Dietrich
As per my understanding this is a direct invocation of method public void didChange(DidChangeTextDocumentParams params) from client what i meant is through rpc. content assist execution is in separate thread.

[Updated on: Thu, 08 December 2022 10:05] by Moderator

Re: Code completion is leading to validation execution in language server [message #1856408 is a reply to message #1856407] Thu, 08 December 2022 10:06 Go to previous messageGo to next message
Eclipse UserFriend
but if you change the file you change the file? so the client tells the server that the file changed.
so you expect didChange not to trigger validation. but how do you want to trigger validation then?
Re: Code completion is leading to validation execution in language server [message #1856409 is a reply to message #1856408] Thu, 08 December 2022 10:11 Go to previous messageGo to next message
Eclipse UserFriend
@Christian Dietrich

validation should be triggered on save ? LanguageServer -> public void didSave(DidSaveTextDocumentParams params) we have empty implementation here.

[Updated on: Thu, 08 December 2022 10:22] by Moderator

Re: Code completion is leading to validation execution in language server [message #1856410 is a reply to message #1856409] Thu, 08 December 2022 10:31 Go to previous messageGo to next message
Eclipse UserFriend
we do live validation. thus validation is triggered on didChange and not on didSave.
of course you can subclass and change that.

[Updated on: Thu, 08 December 2022 10:32] by Moderator

Re: Code completion is leading to validation execution in language server [message #1856411 is a reply to message #1856410] Thu, 08 December 2022 10:33 Go to previous message
Eclipse UserFriend
okay thank you.
Previous Topic:Xcore and mwe2
Next Topic:Xtend IDE 2.21 editor doesn't open and can't build workspace
Goto Forum:
  


Current Time: Sun Apr 20 21:17:42 EDT 2025

Powered by FUDForum. Page generated in 1.42210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top