early prototype of a language server

currently only provides hover info (but that's already quite useful for debugging)
This commit is contained in:
Mark
2023-12-05 23:04:17 +01:00
parent 8b60da8d99
commit 0759b769e0
42 changed files with 892 additions and 26 deletions

View File

@@ -39,8 +39,12 @@ impl SourceRange {
pub fn end(&self) -> SourcePos {
self.end
}
pub fn in_file(&self) -> &Arc<Source> {
&self.in_file
}
}
pub struct CheckError(Vec<CheckErrorComponent>);
#[derive(Clone)]
pub struct CheckError(pub Vec<CheckErrorComponent>);
#[allow(non_upper_case_globals)]
pub mod error_colors {
use colored::Color;
@@ -76,7 +80,8 @@ pub mod error_colors {
pub const BadTypeFromParsed: Color = Color::Blue;
pub const TypeAnnotationNoClosingBracket: Color = Color::Blue;
}
enum CheckErrorComponent {
#[derive(Clone)]
pub enum CheckErrorComponent {
Message(String),
Error(CheckError),
ErrorWithDifferentSource(CheckError),