Skip to content

Commit

Permalink
Merge branch 'master' into feat-cli-repl-tab-completion
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Oct 19, 2020
2 parents b9b3a03 + 08441b8 commit aa03faf
Show file tree
Hide file tree
Showing 28 changed files with 464 additions and 185 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,60 +94,6 @@ jobs:
rustc --version
cargo --version
- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files
# that are needed during the build process. Additionally, this works
# around a bug in the 'cache' action that causes directories outside of
# the workspace dir to be saved/restored incorrectly.
run: echo "::set-env name=CARGO_HOME::$(pwd)/.cargo_home"

- name: Cache
uses: actions/cache@v2
with:
# Note: crates from the denoland/deno git repo always get rebuilt,
# and their outputs ('deno', 'libdeno.rlib' etc.) are quite big,
# so we cache only those subdirectories of target/{debug|release} that
# contain the build output for crates that come from the registry.
path: |-
.cargo_home
target/*/.*
target/*/build
target/*/deps
target/*/gn_out
key: deno-${{ matrix.os }}-${{ matrix.kind }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
deno-${{ matrix.os }}-${{ matrix.kind }}-
# It seems that the 'target' directory does not always get restored
# from cache correctly on MacOS. In the build log we see the following:
#
# Fresh serde_derive v1.0.115
#
# But a little while after that Cargo aborts because 'serde_derive' is
# now nowhere to be found. We're not the only ones experiencing this,
# see https://github.com/actions-rs/cargo/issues/111.
#
# error[E0463]: can't find crate for `serde_derive`
# ##[error] --> /Users/runner/.cargo/registry/src/github.com-
# | 1ecc6299db9ec823/serde-1.0.115/src/lib.rs:285:1
# |
# 285 | extern crate serde_derive;
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
- name: Work around MacOS + Cargo + Github Actions cache bug
if: runner.os == 'macOS'
run: |
cargo clean --locked --release \
-p ast_node \
-p is-macro \
-p serde_derive \
-p swc_ecma_codegen \
-p swc_ecma_codegen_macros \
-p swc_ecma_parser \
-p swc_ecma_parser_macros \
-p swc_visit \
-p swc_visit_macros
- name: lint.py
if: matrix.kind == 'lint'
run: python ./tools/lint.py
Expand Down
58 changes: 29 additions & 29 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ harness = false
path = "./bench/main.rs"

[build-dependencies]
deno_core = { path = "../core", version = "0.63.0" }
deno_core = { path = "../core", version = "0.64.0" }
deno_web = { path = "../op_crates/web", version = "0.15.0" }
deno_fetch = { path = "../op_crates/fetch", version = "0.7.0" }

Expand All @@ -29,9 +29,9 @@ winres = "0.1.11"
winapi = "0.3.9"

[dependencies]
deno_core = { path = "../core", version = "0.63.0" }
deno_doc = "0.1.11"
deno_lint = { version = "0.2.3", features = ["json"] }
deno_core = { path = "../core", version = "0.64.0" }
deno_doc = "0.1.12"
deno_lint = "0.2.4"
deno_web = { path = "../op_crates/web", version = "0.15.0" }
deno_fetch = { path = "../op_crates/fetch", version = "0.7.0" }

Expand All @@ -43,7 +43,7 @@ clap = "2.33.3"
dissimilar = "1.0.2"
dlopen = "0.1.8"
encoding_rs = "0.8.24"
dprint-plugin-typescript = "0.32.4"
dprint-plugin-typescript = "0.32.5"
filetime = "0.2.12"
http = "0.2.1"
indexmap = "1.6.0"
Expand All @@ -61,8 +61,8 @@ rustyline-derive = "0.3.1"
serde = { version = "1.0.116", features = ["derive"] }
sys-info = "0.7.0"
sourcemap = "6.0.1"
swc_common = { version = "=0.10.3", features = ["sourcemap"] }
swc_ecmascript = { version = "=0.9.1", features = ["codegen", "dep_graph", "parser", "react", "transforms", "visit"] }
swc_common = { version = "=0.10.4", features = ["sourcemap"] }
swc_ecmascript = { version = "=0.10.1", features = ["codegen", "dep_graph", "parser", "react", "transforms", "visit"] }
tempfile = "3.1.0"
termcolor = "1.1.0"
tokio = { version = "0.2.22", features = ["full"] }
Expand Down
4 changes: 2 additions & 2 deletions cli/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ declare namespace Deno {
export function rename(oldpath: string, newpath: string): Promise<void>;

/** Synchronously reads and returns the entire contents of a file as utf8
* encoded string. Reading a directory returns an empty string.
* encoded string. Reading a directory throws an error.
*
* ```ts
* const data = Deno.readTextFileSync("hello.txt");
Expand All @@ -1237,7 +1237,7 @@ declare namespace Deno {
export function readTextFileSync(path: string | URL): string;

/** Asynchronously reads and returns the entire contents of a file as utf8
* encoded string. Reading a directory returns an empty string.
* encoded string. Reading a directory throws an error.
*
* ```ts
* const data = await Deno.readTextFile("hello.txt");
Expand Down
25 changes: 19 additions & 6 deletions cli/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ impl LintReporter for PrettyLintReporter {
&pretty_message,
&source_lines,
d.range.clone(),
d.hint.as_ref(),
&fmt_errors::format_location(&JsStackFrame::from_location(
Some(d.filename.clone()),
Some(d.range.start.line as i64),
Expand Down Expand Up @@ -256,6 +257,7 @@ pub fn format_diagnostic(
message_line: &str,
source_lines: &[&str],
range: deno_lint::diagnostic::Range,
maybe_hint: Option<&String>,
formatted_location: &str,
) -> String {
let mut lines = vec![];
Expand Down Expand Up @@ -284,12 +286,23 @@ pub fn format_diagnostic(
}
}

format!(
"{}\n{}\n at {}",
message_line,
lines.join("\n"),
formatted_location
)
if let Some(hint) = maybe_hint {
format!(
"{}\n{}\n at {}\n\n {} {}",
message_line,
lines.join("\n"),
formatted_location,
colors::gray("hint:"),
hint,
)
} else {
format!(
"{}\n{}\n at {}",
message_line,
lines.join("\n"),
formatted_location
)
}
}

#[derive(Serialize)]
Expand Down
Loading

0 comments on commit aa03faf

Please sign in to comment.