Add a basic language server

This commit is contained in:
James Westman 2021-10-22 21:47:05 -05:00
parent e553e5db29
commit b553fc357c
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
5 changed files with 202 additions and 7 deletions

View file

@ -39,6 +39,8 @@ class BlueprintApp:
compile.add_argument("--output", dest="output", default="-")
compile.add_argument("input", metavar="filename", default=sys.stdin, type=argparse.FileType('r'))
compile = self.add_subcommand("lsp", "Run the language server (for internal use by IDEs)", self.cmd_lsp)
self.add_subcommand("help", "Show this message", self.cmd_help)
try:
@ -78,6 +80,10 @@ class BlueprintApp:
e.pretty_print(opts.input.name, data)
sys.exit(1)
def cmd_lsp(self, opts):
langserv = LanguageServer()
langserv.run()
def main():
BlueprintApp().main()