Commit graph

77 commits

Author SHA1 Message Date
Olivier Goffart
8a08e06ee0 LSP: fix completion of properties for local items 2021-04-08 07:54:15 +02:00
Olivier Goffart
81ebb2177e LSP: completion of properties 2021-04-07 23:55:46 +02:00
Olivier Goffart
4f35865a00 Fix panic of the LSP when queriing a token that is not in the document
This can happen in case of parse error, then the document don't constains all the tokens
2021-04-07 11:58:42 +02:00
Olivier Goffart
4aa18feba9 Remove debug output 2021-04-07 08:58:31 +02:00
Olivier Goffart
b195f1be96 LSP preview: use the cache from the LSP, and refresh when the content change 2021-04-06 13:18:37 +02:00
Simon Hausmann
33a9a40e55 Remove outdated comment
Amends 1e4921de13
2021-04-06 13:12:59 +02:00
Simon Hausmann
af33d439a9 Simplify LSP thread startup
After commit 1e4921de13 we don't need wait anymore,
the preview requests themselves will be queued.
2021-04-06 12:44:13 +02:00
Simon Hausmann
b81803774b Start the LSP thread when the gui thread is ready
This way we can serve preview requests immediately.

This basically makes post_event safe to call before the event loop is entered.
The events will be queued up and sent when the event loop
is created and we have access
to the proxy, which will take over the queue.
2021-04-06 11:40:17 +02:00
Simon Hausmann
d9db07db2a Try to gracefully terminate the LSP server when requested 2021-04-06 11:10:30 +02:00
Simon Hausmann
9f2924a642 Begin swapping the event loops in the lsp
Run the preview in the main thread, as required for winit, and run the LSP
main loop in a secondary thread.

At least three more follow-up changes are needed, but this gets the
preview showing for example on macOS.
2021-04-06 10:40:34 +02:00
Olivier Goffart
0cd13d245d LSP: better diagnostic reporting
Don't put the filename in the message, it is already there.
Also handle Warnings as Warnings
2021-04-04 14:48:50 +02:00
Olivier Goffart
309a9274e1 LSP: preview window
Currently not yet live preview from the open document content, but that should totaly be doable
2021-04-03 10:00:12 +02:00
Simon Hausmann
87b320f216 Fix LSP on Windows
Use `to_file_path` to extract the correct path. Just calling `path()` will return something
like `//%3a/Users/blah` instead of `c:\Users\blah`
2021-04-01 13:44:10 +02:00
Simon Hausmann
ffe4ba84b5 Fix LSP diagnostics not disappearing when fixed
To clear diagnostics we must send out empty ones. That means we must always send them for all loaded files and the main file.
2021-03-31 20:47:42 +02:00
Olivier Goffart
014e13b05f Make Diagnostic field private 2021-03-15 10:37:24 +01:00
Olivier Goffart
730b1ccff2 Refactor diagnostic: Merge BuildDiagnostic and FileDiagnostic 2021-03-12 19:32:50 +01:00
Olivier Goffart
11e0be5130 Add the SourceLocation into the Diagnostic 2021-03-12 12:49:19 +01:00
Olivier Goffart
968dfaae87 Put what is the FileDiagnostics into the SourceFile so the SourceFile has the content 2021-03-11 16:23:46 +01:00
Olivier Goffart
57804b64a3 Don't use the canonical path for diagnostics 2020-12-28 15:07:49 +01:00
Olivier Goffart
9aca0b0a7e LSP: Allow to access to the type loader documents
So that we can go to the definition of un-open documents
2020-12-28 12:48:32 +01:00
Olivier Goffart
60c3ceeaa8 Silent warning 2020-12-28 12:48:32 +01:00
Olivier Goffart
2a43575528 Fix license header check
By removing files that needn't to be checked in or adding the right header
2020-12-23 18:08:43 +01:00
Olivier Goffart
b124826fd6 Make the goto definition actually works with vscode 2020-12-23 15:15:53 +01:00
Olivier Goffart
21a86de972 Make the sixtyFPS LSP server load from VSCode 2020-12-23 15:15:53 +01:00
Olivier Goffart
7fcb49bef1 Implement Go to definition for elements 2020-12-23 15:15:53 +01:00
Olivier Goffart
d0158bce78 More work on the LSP 2020-12-23 15:15:53 +01:00
Olivier Goffart
599c92c974 WIP LSP server skeletton
I can run it from Kate, but for some reason it does not work with VSCode yet
2020-12-23 15:15:53 +01:00