fix positionEncoding to be a capability
This commit is contained in:
parent
3dc9e36af6
commit
1a21ee623d
@ -17,56 +17,56 @@ Every time the client sends a message, it gets handled by a function in the corr
|
||||
(local requests [])
|
||||
(local notifications [])
|
||||
|
||||
(local capabilities
|
||||
{:textDocumentSync {:openClose true :change 2}
|
||||
;; :notebookDocumentSync nil
|
||||
:completionProvider {:workDoneProgress false}
|
||||
:hoverProvider {:workDoneProgress false
|
||||
:resolveProvider false
|
||||
:triggerCharacters ["(" "[" "{" "." ":" "\""]
|
||||
:completionItem {:labelDetailsSupport false}}
|
||||
;; :signatureHelpProvider nil
|
||||
;; :declarationProvider nil
|
||||
:definitionProvider {:workDoneProgress false}
|
||||
;; :typeDefinitionProvider nil
|
||||
;; :implementationProvider nil
|
||||
:referencesProvider {:workDoneProgress false}
|
||||
;; :documentHighlightProvider nil
|
||||
;; :documentSymbolProvider nil
|
||||
:codeActionProvider {:workDoneProgress false}
|
||||
;; :codeLensProvider nil
|
||||
;; :documentLinkProvider nil
|
||||
;; :colorProvider nil
|
||||
;; :documentFormattingProvider nil
|
||||
;; :documentRangeFormattingProvider nil
|
||||
;; :documentOnTypeFormattingProvider nil
|
||||
:renameProvider {:workDoneProgress false}})
|
||||
;; :foldingRangeProvider nil
|
||||
;; :executeCommandProvider nil
|
||||
;; :selectionRangeProvider nil
|
||||
;; :linkedEditingRangeProvider nil
|
||||
;; :callHierarchyProvider nil
|
||||
;; :semanticTokensProvider nil
|
||||
;; :monikerProvider nil
|
||||
;; :typeHierarchyProvider nil
|
||||
;; :inlineValueProvider nil
|
||||
;; :inlayHintProvider nil
|
||||
;; ;; this is for PULL diagnostics, but fennel-ls currently does PUSH diagnostics
|
||||
;; :diagnosticProvider {:workDoneProgress false}})
|
||||
;; :workspaceSymbolProvider nil
|
||||
;; :workspace {:workspaceFolders nil
|
||||
;; :documentOperations {:didCreate nil
|
||||
;; :willCreate nil
|
||||
;; :didRename nil
|
||||
;; :willRename nil
|
||||
;; :didDelete nil
|
||||
;; :willDelete nil}})
|
||||
|
||||
(λ requests.initialize [self send params]
|
||||
(state.init-state self params)
|
||||
{:capabilities capabilities
|
||||
:positionEncoding self.position-encoding
|
||||
:serverInfo {:name "fennel-ls" :version "0.1.0"}})
|
||||
(let [capabilities
|
||||
{:positionEncoding self.position-encoding
|
||||
:textDocumentSync {:openClose true :change 2}
|
||||
;; :notebookDocumentSync nil
|
||||
:completionProvider {:workDoneProgress false
|
||||
:resolveProvider false
|
||||
:triggerCharacters ["(" "[" "{" "." ":" "\""]
|
||||
:completionItem {:labelDetailsSupport false}}
|
||||
:hoverProvider {:workDoneProgress false}
|
||||
;; :signatureHelpProvider nil
|
||||
;; :declarationProvider nil
|
||||
:definitionProvider {:workDoneProgress false}
|
||||
;; :typeDefinitionProvider nil
|
||||
;; :implementationProvider nil
|
||||
:referencesProvider {:workDoneProgress false}
|
||||
;; :documentHighlightProvider nil
|
||||
;; :documentSymbolProvider nil
|
||||
:codeActionProvider {:workDoneProgress false}
|
||||
;; :codeLensProvider nil
|
||||
;; :documentLinkProvider nil
|
||||
;; :colorProvider nil
|
||||
;; :documentFormattingProvider {:workDoneProgress false}
|
||||
;; :documentRangeFormattingProvider nil
|
||||
;; :documentOnTypeFormattingProvider nil
|
||||
:renameProvider {:workDoneProgress false}}]
|
||||
;; :foldingRangeProvider nil
|
||||
;; :executeCommandProvider nil
|
||||
;; :selectionRangeProvider nil
|
||||
;; :linkedEditingRangeProvider nil
|
||||
;; :callHierarchyProvider nil
|
||||
;; :semanticTokensProvider nil
|
||||
;; :monikerProvider nil
|
||||
;; :typeHierarchyProvider nil
|
||||
;; :inlineValueProvider nil
|
||||
;; :inlayHintProvider nil
|
||||
;; ;; this is for PULL diagnostics, but fennel-ls currently does PUSH diagnostics
|
||||
;; :diagnosticProvider {:workDoneProgress false}})
|
||||
;; :workspaceSymbolProvider nil
|
||||
;; :workspace {:workspaceFolders nil
|
||||
;; :fileOperations {:didCreate nil
|
||||
;; :willCreate nil
|
||||
;; :didRename nil
|
||||
;; :willRename nil
|
||||
;; :didDelete nil
|
||||
;; :willDelete nil}}
|
||||
;; :experimental nil)
|
||||
{: capabilities
|
||||
:serverInfo {:name "fennel-ls" :version "0.1.0"}}))
|
||||
|
||||
(λ requests.textDocument/definition [self send {: position :textDocument {: uri}}]
|
||||
(let [file (state.get-by-uri self uri)
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
(fn test-offset-encoding []
|
||||
(let [(self [response])
|
||||
(create-client {:params (params-with-encodings [:utf-16])})
|
||||
_ (faith.= :utf-16 (. response :result :positionEncoding))
|
||||
_ (faith.= :utf-16 (. response :result :capabilities :positionEncoding))
|
||||
{: text : cursor :ranges [{: start : end}]} (get-markup "(let [==𐐀𐐀== 100] 𐐀𐐀|)" :utf-16)
|
||||
_ (self:open-file! "foo.fnl" text)
|
||||
[response] (self:definition "foo.fnl" cursor)]
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
(let [(self [response])
|
||||
(create-client {:params (params-with-encodings [:utf-16 :utf-8])})
|
||||
_ (faith.= :utf-8 (. response :result :positionEncoding))
|
||||
_ (faith.= :utf-8 (. response :result :capabilities :positionEncoding))
|
||||
{: text : cursor :ranges [{: start : end}]} (get-markup "(let [==𐐀𐐀== 100] 𐐀𐐀|)" :utf-8)
|
||||
_ (self:open-file! "foo.fnl" text)
|
||||
[response] (self:definition "foo.fnl" cursor)]
|
||||
@ -33,13 +33,13 @@
|
||||
|
||||
;; utf-16 is the fallback
|
||||
(let [(_ [response]) (create-client {:params (params-with-encodings nil)})]
|
||||
(faith.= :utf-16 (. response :result :positionEncoding)))
|
||||
(faith.= :utf-16 (. response :result :capabilities :positionEncoding)))
|
||||
|
||||
(let [(_ [response]) (create-client {:params (params-with-encodings [:random-encoding])})]
|
||||
(faith.= :utf-16 (. response :result :positionEncoding)))
|
||||
(faith.= :utf-16 (. response :result :capabilities :positionEncoding)))
|
||||
|
||||
(let [(_ [response]) (create-client {:params (params-with-encodings [:utf-8 :utf-16])})]
|
||||
(faith.= :utf-8 (. response :result :positionEncoding)))
|
||||
(faith.= :utf-8 (. response :result :capabilities :positionEncoding)))
|
||||
|
||||
nil)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user