Skip to content

Commit e758f72

Browse files
authored
Merge pull request #301 from julia-vscode/disable-workspace-packages
Disable workspace packages for now
2 parents 7b5e33b + 757b6b1 commit e758f72

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

src/imports.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ function _get_field(par, arg, state)
121121
if par isa SymbolServer.EnvStore
122122
if (arg_scope = retrieve_scope(arg)) !== nothing && (tlm = get_named_toplevel_module(arg_scope, arg_str_rep)) !== nothing && hasbinding(tlm)
123123
return bindingof(tlm)
124-
elseif has_workspace_package(state.server, arg_str_rep)
125-
return scopeof(getcst(state.server.workspacepackages[arg_str_rep])).names[arg_str_rep]
124+
# elseif has_workspace_package(state.server, arg_str_rep)
125+
# return scopeof(getcst(state.server.workspacepackages[arg_str_rep])).names[arg_str_rep]
126126
elseif haskey(par, Symbol(arg_str_rep))
127127
if isempty(state.env.project_deps) || Symbol(arg_str_rep) in state.env.project_deps
128128
return par[Symbol(arg_str_rep)]

test/runtests.jl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,32 +1681,32 @@ end
16811681
@test length(StaticLint.loose_refs(bindingof(cst[1][3][3][1]))) == 2
16821682
end
16831683

1684-
@testset "test workspace packages" begin
1685-
empty!(server.files)
1686-
s1 = """
1687-
module WorkspaceMod
1688-
inner_sym = 1
1689-
exported_sym = 1
1690-
export exported_sym
1691-
end"""
1692-
f1 = StaticLint.File("workspacemod.jl", s1, CSTParser.parse(s1, true), nothing, server)
1693-
StaticLint.setroot(f1, f1)
1694-
StaticLint.setfile(server, f1.path, f1)
1695-
StaticLint.semantic_pass(f1)
1696-
server.workspacepackages["WorkspaceMod"] = f1
1697-
s2 = """
1698-
using WorkspaceMod
1699-
exported_sym
1700-
WorkspaceMod.inner_sym
1701-
"""
1702-
f2 = StaticLint.File("someotherfile.jl", s2, CSTParser.parse(s2, true), nothing, server)
1703-
StaticLint.setroot(f2, f2)
1704-
StaticLint.setfile(server, f2.path, f2)
1705-
StaticLint.semantic_pass(f2)
1706-
@test StaticLint.hasref(StaticLint.getcst(f2)[1][2][1])
1707-
@test StaticLint.hasref(StaticLint.getcst(f2)[2])
1708-
@test StaticLint.hasref(StaticLint.getcst(f2)[3][3][1])
1709-
end
1684+
# @testset "test workspace packages" begin
1685+
# empty!(server.files)
1686+
# s1 = """
1687+
# module WorkspaceMod
1688+
# inner_sym = 1
1689+
# exported_sym = 1
1690+
# export exported_sym
1691+
# end"""
1692+
# f1 = StaticLint.File("workspacemod.jl", s1, CSTParser.parse(s1, true), nothing, server)
1693+
# StaticLint.setroot(f1, f1)
1694+
# StaticLint.setfile(server, f1.path, f1)
1695+
# StaticLint.semantic_pass(f1)
1696+
# server.workspacepackages["WorkspaceMod"] = f1
1697+
# s2 = """
1698+
# using WorkspaceMod
1699+
# exported_sym
1700+
# WorkspaceMod.inner_sym
1701+
# """
1702+
# f2 = StaticLint.File("someotherfile.jl", s2, CSTParser.parse(s2, true), nothing, server)
1703+
# StaticLint.setroot(f2, f2)
1704+
# StaticLint.setfile(server, f2.path, f2)
1705+
# StaticLint.semantic_pass(f2)
1706+
# @test StaticLint.hasref(StaticLint.getcst(f2)[1][2][1])
1707+
# @test StaticLint.hasref(StaticLint.getcst(f2)[2])
1708+
# @test StaticLint.hasref(StaticLint.getcst(f2)[3][3][1])
1709+
# end
17101710
@testset "#1218" begin
17111711
cst = parse_and_pass("""function foo(a; p) a+p end
17121712
foo(1, p = true)""")

0 commit comments

Comments
 (0)