Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
23cc954
Do not mark abstract params as unused
antondalgren Feb 14, 2026
ddb34a1
Do not false warn on empty rescue
antondalgren Feb 14, 2026
e1cbee8
Carry over local variable type
antondalgren Feb 14, 2026
a4ba3de
Post-env fallback inference for locals assigned from method calls
antondalgren Feb 16, 2026
ab96cb1
Class-level [] constructor inference + NumberKind fix
antondalgren Feb 16, 2026
a269da4
Infer block parameter types from method-call-assigned receivers
antondalgren Feb 16, 2026
8cd955e
Infer block param types from method block signature
antondalgren Feb 16, 2026
514a0be
Infer generic method return types from call arguments
antondalgren Feb 16, 2026
2e3edc6
Infer array/hash element types and deduplicate union types
antondalgren Feb 16, 2026
cb9ca44
Infer type from block body when method has no return type
antondalgren Feb 16, 2026
ff40655
Expand MacroIf blocks to index methods behind compile-time conditionals
antondalgren Feb 16, 2026
2bfdbf0
Preserve union types for variables reassigned inside conditionals
antondalgren Feb 16, 2026
161859d
Infer block parameter types from chained method calls
antondalgren Feb 16, 2026
36ceaf8
Resolve free type vars from block return type in map-like methods
antondalgren Feb 16, 2026
64b8406
Early return type narrowing
antondalgren Feb 16, 2026
924d4d9
Index C bindings and infer Pointer constructor types
antondalgren Feb 16, 2026
8d6ab28
Fix is_a? narrowing leaking types across method boundaries
antondalgren Feb 16, 2026
15b97b4
Prefer deeper AST node matches in NodeFinder
antondalgren Feb 16, 2026
e0c3fc6
Show type on hover for method parameters
antondalgren Feb 16, 2026
5fdab40
Resolve self.class.method to class methods
antondalgren Feb 16, 2026
2223d13
Fall back to receiver type for unresolved class method calls
antondalgren Feb 16, 2026
d84189a
Register primitive type superclass hierarchy for stdlib
antondalgren Feb 16, 2026
59d4e8a
Infer types from if/case expression assignments
antondalgren Feb 16, 2026
feca81c
Infer type from uninitialized variable declarations
antondalgren Feb 16, 2026
e0eb583
Infer ivar types from getter/property macros with ancestor walk
antondalgren Feb 16, 2026
d7481d3
Fix NodeFinder name_range for @-prefixed Arg params
antondalgren Feb 17, 2026
94b13b1
Support top-level variable inference and .new block params
antondalgren Feb 17, 2026
608e0b4
Skip proc literal Defs in enclosing_def lookup
antondalgren Feb 17, 2026
83770cf
Infer getter return type from default value and fix macro URI navigation
antondalgren Feb 17, 2026
1a755e4
Resolve proc params and classes inside macro-if blocks
antondalgren Feb 17, 2026
b617f64
Use dot separator in hover signatures for proper syntax highlighting
antondalgren Feb 17, 2026
9bcda7b
Infer types for proc literals, block params from yield, and Self reso…
antondalgren Feb 17, 2026
815f79a
Remove redundant hover specs
antondalgren Feb 17, 2026
3b6b181
Show simple getters as property types in hover
antondalgren Feb 17, 2026
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
2 changes: 1 addition & 1 deletion spec/cra/workspace/completion_resolve_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe CRA::Workspace do
contents = resolved.documentation.not_nil!.as_h
contents["kind"].as_s.should eq("markdown")
value = contents["value"].as_s
value.should contain("def Greeter#greet(name)")
value.should contain("def Greeter.greet(name)")
value.should contain("Says hello.")
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/cra/workspace/completion_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,5 @@ describe CRA::Workspace do
labels(items).should contain("foo/baz")
end
end

end
52 changes: 52 additions & 0 deletions spec/cra/workspace/diagnostic_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,41 @@ describe CRA::Workspace do
end
end

it "warns on empty rescue" do
with_tmpdir do |dir|
code = <<-CR
begin
foo
rescue
end
CR
path = File.join(dir, "empty_rescue.cr")
File.write(path, code)
ws = workspace_for(dir)

params = ws.publish_diagnostics("file://#{path}")
params.diagnostics.any? { |d| d.source == "lint" && d.message.includes?("Empty rescue") }.should be_true
end
end

it "does not warn on non-empty rescue" do
with_tmpdir do |dir|
code = <<-CR
begin
foo
rescue
ch.send(nil)
end
CR
path = File.join(dir, "rescue_body.cr")
File.write(path, code)
ws = workspace_for(dir)

params = ws.publish_diagnostics("file://#{path}")
params.diagnostics.any? { |d| d.message.includes?("Empty rescue") }.should be_false
end
end

it "hints trailing whitespace" do
with_tmpdir do |dir|
code = <<-CR
Expand Down Expand Up @@ -221,6 +256,23 @@ describe CRA::Workspace do
end
end

it "does not flag abstract def params as unused" do
with_tmpdir do |dir|
code = <<-CR
abstract class Foo
abstract def foo(a, _b, c)
abstract def bar(a : Int32) : String
end
CR
path = File.join(dir, "abstract_args.cr")
File.write(path, code)
ws = workspace_for(dir)

params = ws.publish_diagnostics("file://#{path}")
params.diagnostics.any? { |d| d.source == "lint" && d.message.includes?("Unused argument") }.should be_false
end
end

it "hints unused block args" do
with_tmpdir do |dir|
code = <<-CR
Expand Down
Loading