Skip to content

Commit

Permalink
Merge pull request #57 from pax-lang/wj/lsp
Browse files Browse the repository at this point in the history
Comprehensive auto-complete for language server
  • Loading branch information
zackbrown authored Oct 16, 2023
2 parents 55aa994 + 0ef180d commit de71ec4
Show file tree
Hide file tree
Showing 27 changed files with 1,306 additions and 261 deletions.
221 changes: 182 additions & 39 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions pax-cartridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-cartridge"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -10,8 +10,8 @@ description = "Static program definition container for Pax programs, intended to

[dependencies]
piet-common = "0.6.0"
pax-core = {path = "../pax-core", version = "0.9.3"}
pax-runtime-api = {path = "../pax-runtime-api", version = "0.9.3"}
pax-properties-coproduct = {path = "../pax-properties-coproduct", version="0.9.3"}
pax-std-primitives = {path = "../pax-std/pax-std-primitives", version = "0.9.3"}
pax-core = {path = "../pax-core", version = "0.9.7"}
pax-runtime-api = {path = "../pax-runtime-api", version = "0.9.7"}
pax-properties-coproduct = {path = "../pax-properties-coproduct", version="0.9.7"}
pax-std-primitives = {path = "../pax-std/pax-std-primitives", version = "0.9.7"}

12 changes: 6 additions & 6 deletions pax-chassis-macos/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pax-chassis-macos"
edition = "2021"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
license = "MIT OR Apache-2.0"
homepage = "https://pax.dev/"
Expand All @@ -15,11 +15,11 @@ crate-type = ["staticlib", "cdylib"]
[dependencies]
piet = "0.6.0"
piet-coregraphics = "0.6.0"
pax-core = { path = "../pax-core", version="0.9.3" }
pax-cartridge = {path="../pax-cartridge", version="0.9.3"}
pax-message = {path = "../pax-message", version="0.9.3"}
pax-runtime-api = {path = "../pax-runtime-api", version="0.9.3"}
pax-properties-coproduct = {path="../pax-properties-coproduct", version="0.9.3"}
pax-core = { path = "../pax-core", version="0.9.7" }
pax-cartridge = {path="../pax-cartridge", version="0.9.7"}
pax-message = {path = "../pax-message", version="0.9.7"}
pax-runtime-api = {path = "../pax-runtime-api", version="0.9.7"}
pax-properties-coproduct = {path="../pax-properties-coproduct", version="0.9.7"}
lazy_static = "1.4.0"
mut_static = "5.0.0"
#be cautious about core-graphics' version number --
Expand Down
12 changes: 6 additions & 6 deletions pax-chassis-web/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-chassis-web"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -17,11 +17,11 @@ default = ["console_error_panic_hook"]
[dependencies]
piet = "0.6.0"
piet-web = "0.6.0"
pax-core = { path = "../pax-core", version="0.9.3" }
pax-properties-coproduct = {path="../pax-properties-coproduct", version="0.9.3"}
pax-cartridge = {path="../pax-cartridge", version="0.9.3"}
pax-runtime-api = {path = "../pax-runtime-api", version="0.9.3"}
pax-message = {path = "../pax-message", version="0.9.3"}
pax-core = { path = "../pax-core", version="0.9.7" }
pax-properties-coproduct = {path="../pax-properties-coproduct", version="0.9.7"}
pax-cartridge = {path="../pax-cartridge", version="0.9.7"}
pax-runtime-api = {path = "../pax-runtime-api", version="0.9.7"}
pax-message = {path = "../pax-message", version="0.9.7"}

wasm-bindgen = {version = "0.2.80", features=["serde-serialize"]}
serde = "1.0.159"
Expand Down
6 changes: 3 additions & 3 deletions pax-chassis-web/interface/public/pax-chassis-web-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,6 @@ var Pax = (() => {
this.growTo(zIndex);
}
element.style.zIndex = String(1e3 - zIndex);
console.log("Layers", this.layers);
console.log("zIndex", zIndex);
console.log("Element", element);
this.layers[zIndex].native.prepend(element);
}
}
Expand Down Expand Up @@ -754,6 +751,9 @@ var Pax = (() => {
leaf.style.display = "flex";
leaf.style.justifyContent = getJustifyContent(linkStyle.align_horizontal);
}
if (linkStyle.font_size) {
textChild.style.fontSize = linkStyle.font_size + "px";
}
if (linkStyle.align_vertical) {
leaf.style.alignItems = getAlignItems(linkStyle.align_vertical);
}
Expand Down
3 changes: 3 additions & 0 deletions pax-chassis-web/interface/src/classes/native-element-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ export class NativeElementPool {
leaf.style.display = "flex";
leaf.style.justifyContent = getJustifyContent(linkStyle.align_horizontal);
}
if (linkStyle.font_size) {
textChild.style.fontSize = linkStyle.font_size + "px";
}
if (linkStyle.align_vertical) {
leaf.style.alignItems = getAlignItems(linkStyle.align_vertical);
}
Expand Down
6 changes: 6 additions & 0 deletions pax-chassis-web/package-lock.json

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

6 changes: 3 additions & 3 deletions pax-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-cli"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -12,12 +12,12 @@ description = "Command line interface tool for developing, packaging, and managi

[dependencies]
clap = "2.33.3"
pax-compiler = {path = "../pax-compiler", version = "0.9.3"}
pax-compiler = {path = "../pax-compiler", version = "0.9.7"}
rustc_version = "0.4.0"
tokio = { version = "1", features = ["full"] }
colored = "2.0.0"
reqwest = "0.11.18"
signal-hook = "0.3"
nix = "0.20.2"
pax-language-server = {path = "../pax-language-server", version = "0.9.3"}
pax-language-server = {version = "0.9.7"}

6 changes: 3 additions & 3 deletions pax-compiler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-compiler"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -31,8 +31,8 @@ tokio = { version = "1", features = ["full"] }
reqwest = { version = "0.11.18", features = ["blocking"] }
tar = "0.4"
fs_extra = "1.3.0"
pax-message = {version = "0.9.3", path="../pax-message"}
pax-runtime-api = {version= "0.9.3", path="../pax-runtime-api"}
pax-message = {version = "0.9.7", path="../pax-message"}
pax-runtime-api = {version= "0.9.7", path="../pax-runtime-api"}
pest = "2.6.0"
pest_derive = "2.6.0"
itertools = "0.10.5"
Expand Down
7 changes: 4 additions & 3 deletions pax-compiler/new-project-template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use pax_lang::*;
use pax_lang::api::*;
use pax_std::primitives::{Group, Text};
use pax_std::types::{Color};
use pax_std::components::{Stacker};
use pax_std::primitives::*;
use pax_std::types::*;
use pax_std::types::text::*;
use pax_std::components::Stacker;

#[derive(Pax)]
#[main]
Expand Down
3 changes: 2 additions & 1 deletion pax-compiler/src/pax.pest
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ empty = {SOI}
block_level_error = { (!(root_tag_pair | settings_block_declaration | handlers_block_declaration) ~ ANY)+}
root_tag_pair = { any_tag_pair }
any_tag_pair = _{statement_control_flow | matched_tag | self_closing_tag | tag_error}
tag_error = { "<" ~ pascal_identifier ~ (!("<" ~ pascal_identifier | "@handlers" | "@settings") ~ ANY)*}
tag_error = { "<" ~ pascal_identifier ~ (!("<" ~ pascal_identifier | "@handlers" | "@settings") ~ ANY)* ~ WHITESPACE* }

//This duo describes an XML-style open-tag, like <SomeElement id="...">
//and matching close-tag, like </SomeElement>. Note the use of Pest's stack feature, `PUSH`
//and `POP`, to match closing & opening tags
Expand Down
8 changes: 4 additions & 4 deletions pax-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-core"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -14,9 +14,9 @@ description = "Core shared runtime and rendering engine for Pax"
piet = "0.6.0"
piet-common = "0.6.0"
kurbo = "0.9.0"
pax-properties-coproduct = { path="../pax-properties-coproduct", version="0.9.3" }
pax-runtime-api = {path = "../pax-runtime-api", version="0.9.3"}
pax-message = {path = "../pax-message", version="0.9.3"}
pax-properties-coproduct = { path="../pax-properties-coproduct", version="0.9.7" }
pax-runtime-api = {path = "../pax-runtime-api", version="0.9.7"}
pax-message = {path = "../pax-message", version="0.9.7"}
wasm-bindgen = {version = "0.2.30", features=["serde-serialize"]}


Expand Down
8 changes: 4 additions & 4 deletions pax-example/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-example"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -9,9 +9,9 @@ repository = "https://www.github.com/pax-lang/pax"
description = "Example and development app for the Pax monorepo and compiler"

[dependencies]
pax-lang = { version="0.9.3", path=".pax/pkg/pax-lang" }
pax-std = { version="0.9.3", path=".pax/pkg/pax-std" }
pax-compiler = {version = "0.9.3", path=".pax/pkg/pax-compiler", optional = true}
pax-lang = { version="0.9.7", path=".pax/pkg/pax-lang" }
pax-std = { version="0.9.7", path=".pax/pkg/pax-std" }
pax-compiler = {version = "0.9.7", path=".pax/pkg/pax-compiler", optional = true}
serde_json = {version = "1.0.95", optional = true}

[features]
Expand Down
1 change: 1 addition & 0 deletions pax-example/src/website_desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pax_lang::api::*;
use pax_lang::*;
use pax_std::components::Stacker;
use pax_std::primitives::{Frame, Group, Image, Rectangle, Scroller, Text};
use pax_std::types::text::*;
use pax_std::types::{Color, Fill, LinearGradient, StackerDirection};

#[derive(Pax)]
Expand Down
1 change: 1 addition & 0 deletions pax-example/src/website_mobile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pax_lang::api::*;
use pax_lang::*;
use pax_std::components::Stacker;
use pax_std::primitives::{Frame, Group, Image, Rectangle, Scroller, Text};
use pax_std::types::text::*;
use pax_std::types::{Color, Fill, LinearGradient, StackerDirection};

#[derive(Pax)]
Expand Down
10 changes: 5 additions & 5 deletions pax-lang/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-lang"
version = "0.9.3"
version = "0.9.7"
authors = ["Zack Brown <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -11,10 +11,10 @@ description = "Root import entry-point for using Pax in a Rust program"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
pax-macro = {path="../pax-macro", version="0.9.3"}
pax-message = {path="../pax-message", version="0.9.3"}
pax-runtime-api = {path="../pax-runtime-api", version="0.9.3"}
pax-compiler = {path="../pax-compiler", optional=true, version="0.9.3"}
pax-macro = {path="../pax-macro", version="0.9.7"}
pax-message = {path="../pax-message", version="0.9.7"}
pax-runtime-api = {path="../pax-runtime-api", version="0.9.7"}
pax-compiler = {path="../pax-compiler", optional=true, version="0.9.7"}

[features]
parser = ["dep:pax-compiler"]
Expand Down
9 changes: 7 additions & 2 deletions pax-language-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pax-language-server"
version = "0.9.3"
version = "0.9.7"
authors = ["Warfa Jibril <[email protected]>"]
license = "MIT OR Apache-2.0"
homepage = "https://pax.dev/"
Expand All @@ -18,6 +18,11 @@ tokio = { version = "1.32.0", features = ["full"] }
tower-lsp = "0.20.0"
proc-macro2 = { version = "1.0", features = ["span-locations"] }
quote = "1.0.33"
pax-compiler = {version = "0.9.3", path="../pax-compiler"}
pax-compiler = {version = "0.9.7", path="../pax-compiler"}
pest = "2.7.4"
pest_derive = "2.7.4"
phf = { version = "0.11.2", features=["macros"] }
once_cell = "1.18.0"
lazy_static = "1.4.0"
ropey = "1.6.0"
regex = "1.10.1"
Loading

0 comments on commit de71ec4

Please sign in to comment.