Skip to content

Commit

Permalink
fix: signature help not working
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Aug 20, 2024
1 parent b6a3682 commit 6e79c64
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker.
* [x] builtin modules analysis
* [x] local scripts analysis
* [x] local packages analysis
* [x] LSP features
* [x] diagnostics
* [x] completion
* [x] rename
* [x] hover
* [x] goto definition
* [x] signature help
* [x] find references
* [x] document symbol
* [x] call hierarchy
* [x] collection types
* [x] `list`
* [x] `dict`
Expand Down Expand Up @@ -135,6 +145,7 @@ pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker.
* [x] type assertion (`typing.cast`)
* [x] type narrowing (`is`, `isinstance`)
* [ ] `pyi` (stub) files support
* [ ] glob pattern file check

---

Expand Down
14 changes: 10 additions & 4 deletions crates/py2erg/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ impl ASTConverter {
}
py_ast::Expr::Call(call) => {
let loc = call.location();
let end_loc = call.end_location();
let function = self.convert_expr(*call.func);
let (pos_args, var_args): (Vec<_>, _) = call
.args
Expand Down Expand Up @@ -1201,10 +1202,15 @@ impl ASTConverter {
.into_iter()
.map(|Keyword { value, .. }| PosArg::new(self.convert_expr(value)))
.next();
let last_col = pos_args
.last()
.and_then(|last| last.col_end())
.unwrap_or(function.col_end().unwrap_or(0) + 1);
let last_col = end_loc.map_or_else(
|| {
pos_args
.last()
.and_then(|last| last.col_end())
.unwrap_or(function.col_end().unwrap_or(0) + 1)
},
|loc| loc.row.get(),
);
let paren = {
let lp = Token::new(
TokenKind::LParen,
Expand Down

0 comments on commit 6e79c64

Please sign in to comment.