Skip to content

Instantly share code, notes, and snippets.

@ZacLN
Last active November 18, 2017 08:59
Show Gist options
  • Save ZacLN/2ea80a0ad7135b9f196159d851d3f1d1 to your computer and use it in GitHub Desktop.
Save ZacLN/2ea80a0ad7135b9f196159d851d3f1d1 to your computer and use it in GitHub Desktop.
debug astronomicaltime linting
using LanguageServer
using CSTParser
for n in names(LanguageServer, true, true)
eval(:(import LanguageServer.$n))
end
import LanguageServer.JSONRPC:Request, parse
import LanguageServer: process, lint
Range = LanguageServer.Range
root = Pkg.dir("QueryOperators")
server = LanguageServerInstance(IOBuffer(), IOBuffer(), true)
process(LanguageServer.parse(Request, """{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":6547,"rootPath":"$root","rootUri":"$root","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true},"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true}},"textDocument":{"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true}},"hover":{"dynamicRegistration":true},"signatureHelp":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"definition":{"dynamicRegistration":true},"codeAction":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true}}},"trace":"off"}}"""), server);
@time process(LanguageServer.parse(Request, """{"jsonrpc":"2.0","method":"initialized","params":{}}"""), server)
for (uri,doc) in server.documents
LanguageServer.parse_all(doc, server)
LanguageServer.lint(doc, server)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment