Skip to content

Commit

Permalink
Add missing plugins in language server (#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev authored Oct 20, 2023
1 parent de318db commit a824486
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/dojo-language-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cairo-lang-language-server.workspace = true
cairo-lang-plugins.workspace = true
cairo-lang-semantic.workspace = true
cairo-lang-starknet.workspace = true
cairo-lang-test-runner.workspace = true
cairo-lang-utils.workspace = true
clap.workspace = true
dojo-lang = { path = "../dojo-lang" }
Expand Down
10 changes: 10 additions & 0 deletions crates/dojo-language-server/src/bin/language_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ use std::sync::Arc;
use cairo_lang_compiler::db::RootDatabase;
use cairo_lang_filesystem::cfg::{Cfg, CfgSet};
use cairo_lang_language_server::Backend;
use cairo_lang_starknet::inline_macros::selector::SelectorMacro;
use cairo_lang_starknet::plugin::StarkNetPlugin;
use cairo_lang_test_runner::plugin::TestPlugin;
use cairo_lang_utils::logging::init_logging;
use clap::Parser;
use dojo_lang::inline_macros::emit::EmitMacro;
use dojo_lang::inline_macros::get::GetMacro;
use dojo_lang::inline_macros::set::SetMacro;
use dojo_lang::plugin::BuiltinDojoPlugin;
use tower_lsp::{LspService, Server};

Expand All @@ -29,8 +34,13 @@ async fn main() {

let db = RootDatabase::builder()
.with_cfg(CfgSet::from_iter([Cfg::name("test")]))
.with_macro_plugin(Arc::new(TestPlugin::default()))
.with_macro_plugin(Arc::new(BuiltinDojoPlugin))
.with_macro_plugin(Arc::new(StarkNetPlugin::default()))
.with_inline_macro_plugin(EmitMacro::NAME, Arc::new(EmitMacro))
.with_inline_macro_plugin(GetMacro::NAME, Arc::new(GetMacro))
.with_inline_macro_plugin(SetMacro::NAME, Arc::new(SetMacro))
.with_inline_macro_plugin(SelectorMacro::NAME, Arc::new(SelectorMacro))
.build()
.unwrap_or_else(|error| {
panic!("Problem creating language database: {error:?}");
Expand Down

0 comments on commit a824486

Please sign in to comment.