@@ -20,6 +20,7 @@ mutable struct Reference{T}
2020end
2121
2222include (" bindings.jl" )
23+ include (" linting.jl" )
2324
2425mutable struct ResolvedRef{T, S}
2526 r:: Reference{T}
@@ -59,10 +60,11 @@ mutable struct State
5960 used_modules:: Vector{Binding}
6061 refs:: Vector{Reference}
6162 includes:: Vector{Include}
63+ linterrors:: Vector{LintError}
6264 server
6365end
64- State () = State (Location (" " , 0 ), Dict {Tuple,Dict} (), ModuleList (), Dict {Tuple,Vector} (),ImportBinding[], Binding[], Reference[], Include[], DocumentServer ())
65- State (path:: String , server) = State (Location (path, 0 ), Dict {Tuple,Any} (), ModuleList (), Dict {Tuple,Vector} (),ImportBinding[], Binding[], Reference[], Include[], server)
66+ State () = State (Location (" " , 0 ), Dict {Tuple,Dict} (), ModuleList (), Dict {Tuple,Vector} (),ImportBinding[], Binding[], Reference[], Include[], LintError[], DocumentServer ())
67+ State (path:: String , server) = State (Location (path, 0 ), Dict {Tuple,Any} (), ModuleList (), Dict {Tuple,Vector} (),ImportBinding[], Binding[], Reference[], Include[], LintError[], server)
6668
6769mutable struct File
6870 cst:: CSTParser.EXPR
@@ -110,9 +112,6 @@ function pass(x, state::State, s::Scope, index, blockref, delayed)
110112 ext_binding (x, state, s) # Get external bindings generated by `x`.
111113 s1 = create_scope (x, state, s) # Create new scope (if needed) for traversing through `x`.
112114 delayed = delayed || s1. t == CSTParser. FunctionDef || x isa CSTParser. EXPR{CSTParser. Export} # Internal scope evaluation is delayed
113- # if delayed && (x isa CSTParser.BinarySyntaxOpCall && x.op.kind == CSTParser.Tokens.DECLARATION)
114- # delayed = false
115- # end
116115 get_include (x, state, s1) # Check whether `x` includes a file.
117116 for a in x # Traverse sub expressions of `x`.
118117 ablockref = get_ref (a, state, s1, blockref, delayed)
@@ -158,6 +157,7 @@ function pass(file::File)
158157 empty! (file. state. imports)
159158 empty! (file. state. exports)
160159 empty! (file. state. used_modules)
160+ empty! (file. state. linterrors)
161161 file. scope = Scope (nothing , Scope[], file. cst. span, CSTParser. TopLevel, file. index, file. nb)
162162 file. scope = pass (file. cst, file. state, file. scope, file. index, false , false )
163163end
@@ -166,7 +166,6 @@ include("references.jl")
166166include (" utils.jl" )
167167include (" documentserver.jl" )
168168include (" helpers.jl" )
169- include (" infer.jl" )
170169include (" display.jl" )
171170
172171end
0 commit comments