LanguageServer.jl
LanguageServer.jl copied to clipboard
add PackageCompile project and compilation script
This PR adds PackageCompiler project that allows to compile LanguageServer into binary file. Compilation script may simplify process for people unfamiliar with PackageCompiler.
This may be used to generate binary releases.
Have to say, that I couldn't get this to work with Emacs. However, compiled version threw the same errors as non-compiled one.
So I do think we should probably only merge it if it works :)
I've only tested against this hand-crafted message:
Content-Length: 1204
{"method":"initialize","id":"61445064-26a1-42a9-916f-99c1f087c523","params":{"trace":"off","capabilities":{"workspace":{"didChangeWatchedFiles":{"dynamicRegistration":false},"didChangeConfiguration":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true},"applyEdit":true,"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true}},"textDocument":{"documentLink":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"signatureHelp":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true},"hover":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"synchronization":{"didSave":true,"willSaveWaitUntil":true,"willSave":true,"dynamicRegistration":true},"definition":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true},"codeAction":{"dynamicRegistration":true},"completion":{"completionItem":{"snippetSupport":true},"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true}}},"rootUri":null,"processId":9902,"rootPath":null},"jsonrpc":"2.0"}
Response was:
Content-Length: 1020
{"id":"61445064-26a1-42a9-916f-99c1f087c523","jsonrpc":"2.0","result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"willSave":false,"willSaveWaitUntil":false,"save":{"includeText":true}},"completionProvider":{"resolveProvider":false,"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"declarationProvider":false,"definitionProvider":true,"typeDefinitionProvider":false,"implementationProvider":false,"referencesProvider":true,"documentHighlightProvider":false,"documentSymbolProvider":true,"codeActionProvider":true,"colorProvider":false,"documentFormattingProvider":true,"documentRangeFormattingProvider":false,"renameProvider":true,"foldingRangeProvider":false,"executeCommandProvider":{"commands":["ExplicitPackageVarImport","ExpandFunction","AddDefaultConstructor","ReexportModule","FixMissingRef"]},"selectionRangeProvider":false,"workspaceSymbolProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}}}}
So, the basic functionality is there.
Turns out that I couldn't run this in Emacs is because of #651.
Added repo option to script for convenience. After applying fix from https://github.com/julia-vscode/LanguageServer.jl/pull/688#issuecomment-627564261 I was able to use binary LanguageServer inside Emacs. It works fine.
Rebased commit
Now running tests before packaging executable. This triggers compilation of package internal functions. Now LanguageServer.jl starts on my machine under one second.