StaticLint.jl icon indicating copy to clipboard operation
StaticLint.jl copied to clipboard

Incorrectly flagged Possible method call error

Open chriswaudby opened this issue 2 years ago • 8 comments

Issue Type: Bug

A simple call to plot is incorrectly highlighted with blue squiggles as a possible method call error:

using Plots

plt = plot(frame=:box,
    grid=nothing,
    xlims=(0,5),
    ylims=(0,0.3),
    xguide="Time / hr",
    yguide="Conc / mM",
    palette=:Paired_12,
    legend=nothing)

Extension version: 1.5.11 VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:00:58.347Z) OS version: Darwin x64 20.6.0 Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz (8 x 2000)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 4, 3
Memory (System) 16.00GB (0.08GB free)
Process Argv --crash-reporter-id 227de7c4-23d0-4ce1-9dfa-e4ef4456279d
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30433507
vsclayoutctrc:30437038
vsrem710cf:30416617
dsvsc008:30440022
pythonvspyt640:30442238
vsbas813:30436447
vscscmwlcmt:30438805
helix:30440343
vsnot107cf:30443615

chriswaudby avatar Mar 08 '22 00:03 chriswaudby

Similar annoying problems with PyPlot:

using PyPlot

pygui(true)

xx = range(0, 2 * pi, length = 10)
fig = figure()
plot(xx, sin.(xx), "k-")

The 'figure' and the 'plot' statement are incorrectly highlighted as 'Possible method call error'

Julia extension:: 1.6.5 VSCode Version: 1.65.2 OS: Windows x64 10.0.19042

dcysarz avatar Mar 22 '22 09:03 dcysarz

The same happens with Chain and params from Flux in this code:

using Flux
a = Chain(x->x, x->x, x->x)
b = params(a, a, a)

However, when writing using Flux: Chain, params, the warnings disappear.

Julia extension: 1.6.6 Linux

graidl avatar Mar 23 '22 13:03 graidl

Julia extension: v1.6.17 VSCode: 1.67.2 OS: Pop_os (20.04)

Happens with xlims!() and ylims!() from Makie as well

image

eirikbrandsaas avatar Jun 07 '22 19:06 eirikbrandsaas

The same happens with Chain and params from Flux in this code:

using Flux
a = Chain(x->x, x->x, x->x)
b = params(a, a, a)

However, when writing using Flux: Chain, params, the warnings disappear.

Julia extension: 1.6.6 Linux

I confirm I am also having this issue with several packages and functions, and that importing package functions explicitly (apologies for my probable improper wording) with

using Package: myfunction

solves the issue for the function myfunction.

Hope the problem gets resolved soon because indede the VSCode Julia extension is almost unusable at the moment.

Julia extension:: 1.7.12 VSCode Version: 1.71.2 OS: Windows x64 10.0.22000

carlogalli avatar Sep 19 '22 09:09 carlogalli

I have a similar issue with Plots. It only happens when I add a new line after a plot() or plot!() call. In the code below. In the code below plot() has the blue squiggles. plot!() does not. If I add a new line after plot!() it will get highlighted.

using Plots
plotlyjs()

x = range(0, 10, length=100)
y1 = sin.(x)
y2 = cos.(x)
p = plot(x, [y1 y2])

y3 = @. sin(x)^2 - 1/2
plot!(p, x, y3)

Julia Version: 1.8.3 Julia VSCode Extension: 1.38.2 VSCode Version: 1.74.1 OS: Windows_NT x64 10.0.19044 WSL2 with Ubuntu 18.04

bEiGeOnE78 avatar Dec 17 '22 15:12 bEiGeOnE78

Not sure if this is the same problem, but the package I'm working on requires only RecipesBase. There plot has 0 methods implemented, hence all of my plot calls (dozens) are squiggly, rendering the Problems pane rather useless.

axsk avatar Jun 09 '23 12:06 axsk

I'm having the same issue.

    pl = plot(title = "Title", xlabel="# Steps", ylabel="Error", scale=:log10)

Is all blue-squiggly underlined.

Julia Version: 1.9.0 Julia VSCode Extension: 1.47.2 VSCode Version: 1.79.2 OS: Ubuntu 22.04.2 LTS

leespen1 avatar Jun 30 '23 17:06 leespen1

I've seen this as well with Docs.doc(::Docs.Binding). Think it's because Docs.doc is defined in Base but all of its methods are implemented in REPL.

jonathan-conder-sm avatar Jul 10 '23 04:07 jonathan-conder-sm