Skip to content

Commit c1ba75f

Browse files
committed
Revert some unrelated changes
1 parent 271e934 commit c1ba75f

File tree

5 files changed

+48
-58
lines changed

5 files changed

+48
-58
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@ module.exports = {
1717
browser: true,
1818
node: true,
1919
},
20-
rules: {
21-
"@typescript-eslint/no-explicit-any": "off",
22-
},
2320
};

.prettierignore

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ __pycache__/
44
.cargo/
55
.github/
66
.vscode/
7-
.venv/
8-
/compiler/
9-
/jupyterlab/.pytest_cache/
10-
/jupyterlab/lib/
11-
/jupyterlab/qsharp_jupyterlab/labextension/
12-
/library/
13-
/npm/dist/
14-
/npm/lib/
15-
/npm/src/*.generated.ts
16-
/pip/.pytest_cache/
17-
/pip/src/**/*.html
18-
/playground/public/libs/
19-
/samples/
20-
/target/
21-
/vscode/out/
22-
/wasm/
7+
compiler/
8+
jupyterlab/.pytest_cache/
9+
jupyterlab/lib/
10+
jupyterlab/.venv/
11+
jupyterlab/qsharp_jupyterlab/labextension/
12+
library/
13+
npm/dist/
14+
npm/lib/
15+
npm/src/*.generated.ts
16+
pip/.venv/
17+
pip/.pytest_cache/
18+
pip/src/**/*.html
19+
playground/public/libs/
20+
samples/
21+
target/
22+
vscode/out/
23+
wasm/

language_service/src/hover.rs

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
mod tests;
66

77
use crate::qsc_utils::{map_offset, span_contains, Compilation};
8-
use qsc::hir::{ty::Ty, visit::Visitor, CallableKind, Item, ItemKind};
8+
use qsc::hir::{ty::Ty, visit::Visitor, CallableDecl, CallableKind};
99

1010
#[derive(Debug, PartialEq)]
1111
pub struct Hover {
@@ -53,43 +53,39 @@ struct CallableFinder {
5353
}
5454

5555
impl Visitor<'_> for CallableFinder {
56-
fn visit_item(&mut self, item: &Item) {
57-
if let ItemKind::Callable(decl) = &item.kind {
58-
if span_contains(decl.name.span, self.offset) {
59-
let kind = match decl.kind {
60-
CallableKind::Function => "function",
61-
CallableKind::Operation => "operation",
62-
};
56+
fn visit_callable_decl(&mut self, decl: &CallableDecl) {
57+
if span_contains(decl.name.span, self.offset) {
58+
let kind = match decl.kind {
59+
CallableKind::Function => "function",
60+
CallableKind::Operation => "operation",
61+
};
6362

64-
let header = format!(
65-
"```qsharp
63+
// Doc comments would be formatted as markdown into this
64+
// string once we're able to parse them out.
65+
let header = format!(
66+
"```qsharp
6667
{} {}{} : {}
6768
```
68-
69-
{}
70-
7169
",
72-
kind,
73-
decl.name.name,
74-
match &decl.input.ty {
75-
Ty::Tuple(items) => {
76-
// I'm just doing this so I can format Unit as ()
77-
if items.is_empty() {
78-
"()".to_string()
79-
} else {
80-
format!("{}", &decl.input.ty)
81-
}
70+
kind,
71+
decl.name.name,
72+
match &decl.input.ty {
73+
Ty::Tuple(items) => {
74+
// I'm just doing this so I can format Unit as ()
75+
if items.is_empty() {
76+
"()".to_string()
77+
} else {
78+
format!("{}", &decl.input.ty)
8279
}
83-
x => x.to_string(),
84-
},
85-
decl.output,
86-
item.doc
87-
);
80+
}
81+
x => x.to_string(),
82+
},
83+
decl.output
84+
);
8885

89-
self.header = Some(header);
90-
self.start = decl.name.span.lo;
91-
self.end = decl.name.span.hi;
92-
}
86+
self.header = Some(header);
87+
self.start = decl.name.span.lo;
88+
self.end = decl.name.span.hi;
9389
}
9490
}
9591
}

language_service/src/hover/tests.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ fn hover_callable() {
1717
"#,
1818
Some(indoc!(
1919
r#"```qsharp
20-
operation Foo() : Unit
21-
```
22-
23-
Doc comment!
24-
20+
operation Foo() : Unit
21+
```
2522
"#
2623
)),
2724
);

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)