Skip to content

Commit

Permalink
Implemented a MOOS Mission Parser.
Browse files Browse the repository at this point in the history
Implemented a MOOS Mission Parser. Still a lot of work to do, but
the tokens are getting rendered in VSCode. Still need to add
application specific handling.
  • Loading branch information
cgagner committed Apr 10, 2024
1 parent ec0e601 commit cbfd170
Show file tree
Hide file tree
Showing 13 changed files with 728 additions and 687 deletions.
8 changes: 7 additions & 1 deletion moos-ivp-language-server/src/cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::parsers::nsplug;
use crate::parsers::{moos, nsplug};

use lsp_types::{
Diagnostic, DocumentLink, FoldingRange, InlayHint, SemanticToken, SemanticTokenModifier,
SemanticTokens, Url,
Expand Down Expand Up @@ -60,6 +61,8 @@ pub enum TokenTypes {
Type,
/// Namespace
Namespace,
/// Struct
Struct,
}

impl Into<u32> for TokenTypes {
Expand Down Expand Up @@ -198,7 +201,10 @@ impl Document {

pub fn refresh(&mut self) {
self.clear();

// TODO: Check File Type
nsplug::parse(self);
moos::parse(self);
}

pub fn clear(&mut self) {
Expand Down
1 change: 1 addition & 0 deletions moos-ivp-language-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ fn main() -> Result<(), Box<dyn Error + Sync + Send>> {
SemanticTokenType::OPERATOR,
SemanticTokenType::TYPE,
SemanticTokenType::NAMESPACE,
SemanticTokenType::STRUCT,
],
token_modifiers: vec![
SemanticTokenModifier::DECLARATION,
Expand Down
1 change: 1 addition & 0 deletions moos-ivp-language-server/src/parsers/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod moos;
pub mod nsplug;
Loading

0 comments on commit cbfd170

Please sign in to comment.