Skip to content

No method matching dirname(::Nothing) #630

Description

@theogf

Pre-submission checklist

Client

Neovim

Julia versioninfo()

1.12

JETLS version

2024-04-06

Reproduction with the VSCode reference client

  • I have confirmed this issue also reproduces with the VSCode reference client.
  • This issue does NOT reproduce with the VSCode reference client, but I believe JETLS-side changes are needed.

Description

I have a bunch of submodules that start with:

include(joinpath(dirname(pathof(parentmodule(@__MODULE__))), "docstrings.jl"))

This create an error diagnostic with

MethodError: no method matching dirname(::Nothing)
   │ │ │      The function `dirname` exists, but no method is defined for this combination of argument types.
   │ │ │      
   │ │ │      Closest candidates are:
   │ │ │        dirname(!Matched::FilePathsBase.AbstractPath)
   │ │ │         @ FilePathsBase ~/.julia/packages/FilePathsBase/NV2We/src/aliases.jl:11
   │ │ │        dirname(!Matched::AbstractString)
   │ │ │         @ Base path.jl:183 JETLS/save (toplevel/error) [3, 1]

Steps to reproduce

Create a submodule with the line above, run the jetls diagnostics on it.

JETLS configuration (if applicable)

No response

Additional context (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions