2021-01-11 12:13:41 -05:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2020-12-21 08:44:26 -05:00
|
|
|
use deno_core::error::AnyError;
|
|
|
|
use lspower::LspService;
|
|
|
|
use lspower::Server;
|
2020-12-07 05:46:39 -05:00
|
|
|
|
|
|
|
mod analysis;
|
|
|
|
mod capabilities;
|
|
|
|
mod config;
|
|
|
|
mod diagnostics;
|
2020-12-21 08:44:26 -05:00
|
|
|
mod language_server;
|
2020-12-07 05:46:39 -05:00
|
|
|
mod memory_cache;
|
|
|
|
mod sources;
|
|
|
|
mod text;
|
|
|
|
mod tsc;
|
|
|
|
mod utils;
|
|
|
|
|
2020-12-21 08:44:26 -05:00
|
|
|
pub async fn start() -> Result<(), AnyError> {
|
|
|
|
let stdin = tokio::io::stdin();
|
|
|
|
let stdout = tokio::io::stdout();
|
2020-12-07 05:46:39 -05:00
|
|
|
|
2020-12-21 08:44:26 -05:00
|
|
|
let (service, messages) =
|
|
|
|
LspService::new(language_server::LanguageServer::new);
|
|
|
|
Server::new(stdin, stdout)
|
|
|
|
.interleave(messages)
|
|
|
|
.serve(service)
|
|
|
|
.await;
|
2020-12-07 05:46:39 -05:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|