Add tests for editing flsconfig
This commit is contained in:
parent
c1f9dc448a
commit
58c79a727e
@ -1,5 +1,6 @@
|
|||||||
(local faith (require :faith))
|
(local faith (require :faith))
|
||||||
(local {: create-client} (require :test.utils))
|
(local {: create-client} (require :test.utils))
|
||||||
|
(local fennel (require :fennel))
|
||||||
|
|
||||||
(fn test-path []
|
(fn test-path []
|
||||||
(let [{: client : uri : cursor :locations [location]}
|
(let [{: client : uri : cursor :locations [location]}
|
||||||
@ -60,7 +61,18 @@
|
|||||||
(faith.not= [] bad)
|
(faith.not= [] bad)
|
||||||
(faith.= [] good)))
|
(faith.= [] good)))
|
||||||
|
|
||||||
|
(fn test-editing-settings []
|
||||||
|
(let [{: client : uri} (create-client {:main.fnl ""
|
||||||
|
:flsproject.fnl "{}"})
|
||||||
|
uri (uri:gsub "main" "flsproject")]
|
||||||
|
(client:pretend-this-file-exists! uri "{:extra-globals \"my-new-global\"}")
|
||||||
|
(client:did-save uri)
|
||||||
|
(faith.= "my-new-global" client.server.configuration.extra-globals)
|
||||||
|
(local _ nil))
|
||||||
|
nil)
|
||||||
|
|
||||||
{: test-path
|
{: test-path
|
||||||
: test-extra-globals
|
: test-extra-globals
|
||||||
: test-lints
|
: test-lints
|
||||||
: test-native-libaries}
|
: test-native-libaries
|
||||||
|
: test-editing-settings}
|
||||||
|
|||||||
@ -63,6 +63,12 @@
|
|||||||
:textDocument {:uri file}
|
:textDocument {:uri file}
|
||||||
:context {:diagnostics []}})))
|
:context {:diagnostics []}})))
|
||||||
|
|
||||||
|
(fn did-save [self file]
|
||||||
|
(dispatch.handle* self.server
|
||||||
|
(message.create-notification :textDocument/didSave
|
||||||
|
{:textDocument {:uri file}})))
|
||||||
|
|
||||||
|
|
||||||
(local client-mt
|
(local client-mt
|
||||||
{:__index {: open-file!
|
{:__index {: open-file!
|
||||||
: pretend-this-file-exists!
|
: pretend-this-file-exists!
|
||||||
@ -71,7 +77,8 @@
|
|||||||
: hover
|
: hover
|
||||||
: references
|
: references
|
||||||
: rename
|
: rename
|
||||||
: code-action}})
|
: code-action
|
||||||
|
: did-save}})
|
||||||
|
|
||||||
{: client-mt
|
{: client-mt
|
||||||
: default-encoding
|
: default-encoding
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user