Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:08 Go to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 56
Registered: May 2020
Member
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 13:09]

Report message to a moderator

Re: Code completion is leading to validation execution in language server [message #1856399 is a reply to message #1856398] Thu, 08 December 2022 13:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Code completion is leading to validation execution in language server [message #1856402 is a reply to message #1856399] Thu, 08 December 2022 13:52 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 56
Registered: May 2020
Member
@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 91 times)

[Updated on: Thu, 08 December 2022 14:35]

Report message to a moderator

Re: Code completion is leading to validation execution in language server [message #1856405 is a reply to message #1856402] Thu, 08 December 2022 14:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
but where is content assist in this picture?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com

[Updated on: Thu, 08 December 2022 14:51]

Report message to a moderator

Re: Code completion is leading to validation execution in language server [message #1856407 is a reply to message #1856405] Thu, 08 December 2022 15:04 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 56
Registered: May 2020
Member
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 15:05]

Report message to a moderator

Re: Code completion is leading to validation execution in language server [message #1856408 is a reply to message #1856407] Thu, 08 December 2022 15:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
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?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Code completion is leading to validation execution in language server [message #1856409 is a reply to message #1856408] Thu, 08 December 2022 15:11 Go to previous messageGo to next message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 56
Registered: May 2020
Member
@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 15:22]

Report message to a moderator

Re: Code completion is leading to validation execution in language server [message #1856410 is a reply to message #1856409] Thu, 08 December 2022 15:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14738
Registered: July 2009
Senior Member
we do live validation. thus validation is triggered on didChange and not on didSave.
of course you can subclass and change that.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com

[Updated on: Thu, 08 December 2022 15:32]

Report message to a moderator

Re: Code completion is leading to validation execution in language server [message #1856411 is a reply to message #1856410] Thu, 08 December 2022 15:33 Go to previous message
Nagaraj Kandoor is currently offline Nagaraj KandoorFriend
Messages: 56
Registered: May 2020
Member
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: Fri Dec 27 02:48:31 GMT 2024

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

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

Back to the top