Skip to content

Commit

Permalink
fix(compiler): regex is not bringable module (#7092)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr authored Sep 9, 2024
1 parent 90a8077 commit c8abdf3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
4 changes: 1 addition & 3 deletions packages/@winglang/wingc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,19 @@ const WINGSDK_HTTP_MODULE: &'static str = "http";
const WINGSDK_MATH_MODULE: &'static str = "math";
const WINGSDK_AWS_MODULE: &'static str = "aws";
const WINGSDK_EXPECT_MODULE: &'static str = "expect";
const WINGSDK_REGEX_MODULE: &'static str = "regex";
const WINGSDK_FS_MODULE: &'static str = "fs";
const WINGSDK_SIM_MODULE: &'static str = "sim";
const WINGSDK_UI_MODULE: &'static str = "ui";

pub const UTIL_CLASS_NAME: &'static str = "Util";

const WINGSDK_BRINGABLE_MODULES: [&'static str; 10] = [
const WINGSDK_BRINGABLE_MODULES: [&'static str; 9] = [
WINGSDK_CLOUD_MODULE,
WINGSDK_UTIL_MODULE,
WINGSDK_HTTP_MODULE,
WINGSDK_MATH_MODULE,
WINGSDK_AWS_MODULE,
WINGSDK_EXPECT_MODULE,
WINGSDK_REGEX_MODULE,
WINGSDK_FS_MODULE,
WINGSDK_SIM_MODULE,
WINGSDK_UI_MODULE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
source: libs/wingc/src/lsp/completions.rs
source: packages/@winglang/wingc/src/lsp/completions.rs
---
- label: aws
kind: 9
Expand All @@ -19,9 +19,6 @@ source: libs/wingc/src/lsp/completions.rs
- label: math
kind: 9
sortText: kk|math
- label: regex
kind: 9
sortText: kk|regex
- label: sim
kind: 9
sortText: kk|sim
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
source: libs/wingc/src/lsp/completions.rs
source: packages/@winglang/wingc/src/lsp/completions.rs
---
- label: aws
kind: 9
Expand All @@ -19,9 +19,6 @@ source: libs/wingc/src/lsp/completions.rs
- label: math
kind: 9
sortText: kk|math
- label: regex
kind: 9
sortText: kk|regex
- label: sim
kind: 9
sortText: kk|sim
Expand Down
6 changes: 6 additions & 0 deletions tests/invalid/bring.test.w
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ bring ;
//^^^^^ Expected module specification (see https://www.winglang.io/docs/libraries)
bring c;
//^^^^^^ "c" is not a built-in module

bring regex;
//^ "Could not find a trusted library "@winglibs/regex" installed"

bring num;
//^ Could not find a trusted library "@winglibs/num" installed
14 changes: 14 additions & 0 deletions tools/hangar/__snapshots__/invalid.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,20 @@ error: Could not find a trusted library "@winglibs/c" installed. Did you mean to
| ^^^^^^^^


error: Could not find a trusted library "@winglibs/regex" installed. Did you mean to run \`npm i @winglibs/regex\`?
--> ../../../tests/invalid/bring.test.w:11:1
|
11 | bring regex;
| ^^^^^^^^^^^^


error: Could not find a trusted library "@winglibs/num" installed. Did you mean to run \`npm i @winglibs/num\`?
--> ../../../tests/invalid/bring.test.w:14:1
|
14 | bring num;
| ^^^^^^^^^^


error: Redundant bring of "std"
--> ../../../tests/invalid/bring.test.w:1:1
|
Expand Down

0 comments on commit c8abdf3

Please sign in to comment.