Skip to content

GuruDhanush/Deluge-Language-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deluge language parser

Build Status codecov GitHub Releases GitHub release (latest SemVer)

Created using parser combinators in dart. More info about deluge can be found here. The package aims to parse cliq compatible deluge according to the externally available documentation.

The code is packaged to aot and is released for all three platform Window, Linux and Mac.

Demo: Online-Editor

Benchmark

Deluge code from the extension samples was taken and packaged as one file with 55KB size and 1923 LOC. Benchmark ran on i7 7500U @2.7GHZ using dart sdk 2.6.0.1-dev-0 on windows 10 build 18363.356 .

aot jit
290ms 242ms

Incremental compilation is yet to be implemented. In the mean time some parse requests are debounced.

LSP Method status

Method Implementation
initialize
initialized
cancelRequest
window/showMessage
window/showMessageRequest
window/logMessage
textDocument/didOpen
textDocument/didChange
textDocument/didClose
textDocument/publishDiagnostics
textDocument/hover
textDocument/documentSymbol
textDocument/codeLens
codeLens/resolve

Custom notification

custom/updateStatusBarItem

Direction: Server -> Client.

Params: { "status": true|false }

Custom methods

custom/updateDocsLocation

Direction: Client -> Server.

Params: { "folder": string, "fileName": string }

Compiling for web

Dart apart from compiling to native code which was leveraged in the vscode extension, can also compile to javascript. The lang server can b compiled to javascript and interface with monaco-editor, the editor that powers vscode.

The entry point is in \bin\web.dart. Its interfaces with monaco-editor via service worker.

Features

  • Text Sync
  • Diagnostics

The seperate web project is hosted in here.

Compiling for web

dart2js .\bin\web.dart -m