Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.1.13 #37

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions book/src/trait-debugging-101.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ Argus sorts the failing leaves in the Bottom-Up view by which are "most-likely"

The above demonstrates that Argus identifies `Res: IntoResponse` as a root cause of the overall failure in addition to the second failure: `LoginAttempt: FromRequestParts<_, _>`. The note icon in the Bottom-Up view indicates that the two failures must be resolved together if you want to us the function as a handler.

It's always important to **read** and **understand** the failing obligation(s) that Argus presents first in the Bottom Up view. These errors are the *leaves* of the search tree, in other words, the *root cause* of the overall error; if you satisfy these bounds, then the root bound will also be satisfied.

If additional failing bounds are present under "Other failures," you need to only resolve a single set of these failures. Argus shows you the set it believes was your intent, but as the developer with intent double check for yourself that it makes sense.

<video controls>
<source alt="Fix Future and IntoResponse" src="assets/axum-hello-server/async-fix-response.mp4" type="video/mp4" />
</video>
Expand Down
6 changes: 3 additions & 3 deletions crates/argus-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "argus-cli"
version = "0.1.12"
version = "0.1.13"
edition = "2021"
authors = ["Gavin Gray <[email protected]>"]
repository = "https://github.com/cognitive-engineering-lab/argus"
Expand All @@ -10,8 +10,8 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
argus-lib = { version = "0.1.12", path = "../argus" }
argus-ext = { version = "0.1.12", path = "../argus-ext" }
argus-lib = { version = "0.1.13", path = "../argus" }
argus-ext = { version = "0.1.13", path = "../argus-ext" }
rustc_plugin = "=0.10.0-nightly-2024-05-20"

rustc_utils.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/argus-ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "argus-ext"
version = "0.1.12"
version = "0.1.13"
edition = "2021"
authors = ["Gavin Gray <[email protected]>"]
repository = "https://github.com/cognitive-engineering-lab/argus"
Expand Down
4 changes: 2 additions & 2 deletions crates/argus-ser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "argus-ser"
version = "0.1.12"
version = "0.1.13"
edition = "2021"
authors = ["Gavin Gray <[email protected]>"]
repository = "https://github.com/cognitive-engineering-lab/argus"
Expand Down Expand Up @@ -28,7 +28,7 @@ smallvec = "1.11.2"
itertools = "0.12.0"
ts-rs = { version = "7.1.1", features = ["indexmap-impl"], optional = true }
index_vec = { version = "0.1.3", features = ["serde"] }
argus-ext = { version = "0.1.12", path = "../argus-ext" }
argus-ext = { version = "0.1.13", path = "../argus-ext" }

[dev-dependencies]
argus-ser = { path = ".", features = ["testing"] }
Expand Down
8 changes: 4 additions & 4 deletions crates/argus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "argus-lib"
version = "0.1.12"
version = "0.1.13"
edition = "2021"
authors = ["Gavin Gray <[email protected]>"]
repository = "https://github.com/cognitive-engineering-lab/argus"
Expand All @@ -21,8 +21,8 @@ fluid-let.workspace = true
serde.workspace = true
serde_json.workspace = true

argus-ext = { version = "0.1.12", path = "../argus-ext" }
argus-ser = { version = "0.1.12", path = "../argus-ser" }
argus-ext = { version = "0.1.13", path = "../argus-ext" }
argus-ser = { version = "0.1.13", path = "../argus-ser" }
index_vec = { version = "0.1.3", features = ["serde"] }
smallvec = "1.11.2"
itertools = "0.12.0"
Expand All @@ -35,7 +35,7 @@ ts-rs = { version = "7.1.1", features = ["indexmap-impl"], optional = true }

[dev-dependencies]
argus-lib = { path = ".", features = ["testing"] }
argus-ser = { version = "0.1.12", path = "../argus-ser", features = ["testing"] }
argus-ser = { version = "0.1.13", path = "../argus-ser", features = ["testing"] }
rustc_utils = { version = "=0.10.0-nightly-2024-05-20", features = ["serde", "ts-rs"] }
test-log = "0.2.11"
env_logger = "0.9.3"
Expand Down
2 changes: 1 addition & 1 deletion ide/packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "A trait debugger for Rust",
"license": "MIT",
"icon": "argus-logo-128.png",
"version": "0.1.12",
"version": "0.1.13",
"engines": {
"vscode": "^1.79.0"
},
Expand Down
25 changes: 24 additions & 1 deletion ide/packages/panoptes/src/Code.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,30 @@ pre.shiki {
font-family: var(--vscode-editor-font-family);
}


/* Change the code colors based on VSCode exported body classes */
/* Light is the default, we need to catch dark and high-contrast themes. */

body.vscode-high-contrast .shiki,
body.vscode-high-contrast .shiki span {
color: var(--shiki-contrast-dark) !important;
background-color: transparent !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-contrast-dark-font-style) !important;
font-weight: var(--shiki-contrast-dark-font-weight) !important;
text-decoration: var(--shiki-contrast-dark-text-decoration) !important;
}

body.vscode-high-contrast-light .shiki,
body.vscode-high-contrast-light .shiki span {
color: var(--shiki-contrast-light) !important;
background-color: transparent !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-contrast-light-font-style) !important;
font-weight: var(--shiki-contrast-light-font-weight) !important;
text-decoration: var(--shiki-contrast-light-text-decoration) !important;
}

body.vscode-dark .shiki,
body.vscode-dark .shiki span {
color: var(--shiki-dark) !important;
Expand All @@ -22,4 +45,4 @@ body.vscode-dark .shiki span {
font-style: var(--shiki-dark-font-style) !important;
font-weight: var(--shiki-dark-font-weight) !important;
text-decoration: var(--shiki-dark-text-decoration) !important;
}
}
24 changes: 16 additions & 8 deletions ide/packages/panoptes/src/Code.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import MonoSpace from "@argus/print/MonoSpace";
import { VSCodeProgressRing } from "@vscode/webview-ui-toolkit/react";
import _ from "lodash";
import React, { useEffect, useState } from "react";
import { type Highlighter, getHighlighter } from "shiki";

import "./Code.css";

const ARGUS_THEMES = {
dark: "dark-plus",
light: "light-plus",
"contrast-dark": "synthwave-84",
"contrast-light": "github-light-default"
};

const mkHighlighter = (() => {
let h: Promise<Highlighter | undefined>;
try {
h = getHighlighter({
themes: ["dark-plus", "light-plus"],
themes: _.values(ARGUS_THEMES),
langs: ["rust"]
});
} catch (e: any) {
Expand All @@ -21,18 +29,18 @@ const mkHighlighter = (() => {
})();

const codeToHtml = async ({ code, lang }: { code: string; lang: string }) => {
const highlighter = await mkHighlighter();
// TODO: I haven't tested that this works because Shiki has yet to fail :)
if (!highlighter) {
let highlighter: Highlighter | undefined;

try {
highlighter = await mkHighlighter();
if (!highlighter) throw new Error("Highlighter not initialized");
} catch (e: any) {
return `<pre>${code}</pre>`;
}

return highlighter.codeToHtml(code, {
lang,
themes: {
dark: "dark-plus",
light: "light-plus"
},
themes: ARGUS_THEMES,
defaultColor: "light"
});
};
Expand Down
4 changes: 2 additions & 2 deletions ide/packages/panoptes/src/TreeView/TreeApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { TyCtxt } from "@argus/print/context";
import React from "react";

import BottomUp from "./BottomUp";
import Erotisi from "./Erotisi";
import Panels, { type PanelDescription, usePanelState } from "./Panels";
import TopDown from "./TopDown";
import "./TreeApp.css";
Expand Down Expand Up @@ -72,8 +71,9 @@ const TreeApp = ({
)
});

// FIXME: we will want to include this eventually, but not right now.
// Push to place this last
tabs.push({ title: "Help Me", Content: Erotisi });
// tabs.push({ title: "Help Me", Content: Erotisi });
}

// HACK: we shouldn't test for eval mode here but Playwright is off on the button click.
Expand Down
7 changes: 5 additions & 2 deletions ide/packages/panoptes/src/TreeView/Wrappers.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
}

.WrapperBox {
display: none;
/* display: none; */
display: inline;
opacity: 0.20;
padding-left: 0.5em;
}

.WrapperBox.is-hovered {
display: inline;
/* display: inline; */
opacity: 100;
}

.WrapperBox i.codicon {
Expand Down
Loading