Skip to content

LSP: Completions for attribute override definitions #2431

@DMunkei

Description

@DMunkei

Describe the Bug

Hey!

I've been trying out Pyrefly, and really hoping this becomes my daily driver. However, I've noticed some issues when doing basic inheritance. The members from the Parent class aren't suggested/recognized when declaring/overriding them from a subclass.

I've set up a sandbox with a minimal example.

Neovim version:

NVIM v0.11.5
Build type: Release
LuaJIT 2.1.1763318511
Run "nvim -V1 -v" for more info

Python version: 3.12.13
Pyrefly version from Mason:

    ◍ pyrefly (keywords: python)
      Pyrefly, a faster Python type checker written in Rust

      installed version 0.52.0                  
      installed purl    pkg:pypi/pyrefly@0.52.0 
      homepage          https://pyrefly.org/    
      languages         Python                  
      categories        Linter, LSP             
      executables       pyrefly                 

The pyrefly lsp configuration file:

local ok, blink = pcall(require, "blink.cmp")
if not ok then
	return {}
end
local capabilities = blink.get_lsp_capabilities()
---@brief
---
--- https://pyrefly.org/
---
---`pyrefly`, a faster Python type checker written in Rust.
--
-- `pyrefly` is still in development, so please report any errors to
-- our issues page at https://github.com/facebook/pyrefly/issues.

---@type vim.lsp.Config
return {
	capabilities = capabilities,
	cmd = { "pyrefly", "lsp" },
	filetypes = { "python" },
	root_markers = {
		"pyrefly.toml",
		"pyproject.toml",
		"setup.py",
		"setup.cfg",
		"requirements.txt",
		"Pipfile",
		".git",
	},
	on_exit = function(code, _, _)
		vim.notify("Closing Pyrefly LSP exited with code: " .. code, vim.log.levels.INFO)
	end,
}

Hope this helps, if you need more info, let me know :)

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxAAQDqMUAxrgLYzUAuunAFuwAqkATjDBRS1AMoYcBADS8IcakuqpqxVAHMYAHXQ0A7nxHVSuAK7VGGaoaEQOMBXB6pTM6rHfo1eCxycpMQQ6FoqvoIcPLjohPqUCdQAEjAeHtaWxLDUYDCoHBYiyrhgispoWHj4iEkAtNQA4jCBIqhQdRwQbEHE7Ix8jADWoeF5MDiow-XUAKpw7CIAbvlQAPocwTAAFACUnNyhcH2MgaF5QiKYvfAzMPh9DmzogYaOPLzsAJIAIgCiuXyhWKvAKdnYcAsxGIuCEgW2MEIWkIagCuGYLGyLWc1C0uE6%2BMwolCjggsQUMRWQgULUYuxmtAcTjUWGoQgskVI0VimSJ1EwEBEp3EETMliE1GwQlwhgWQn0YGlLF6oxUmNhgQAVAqlX5GGqYXDqABBABCAGEFKhsHAOEIphw2NzMPpXehGFBUHBlMbtmbzbtar5qCGAALEaWPTb6ENh622%2B2nJ0xF3BkNEsppaVCNZsb3aHYLKBgQMx2Pl3QgSvVtPl6jmnjQa4er0LZQsCy2jTSpYQPnqLOw6h5tA6agJ0bxWsVquzst16iEJdulve6imv2l2uDnMjgvUAC81ErPBYLBr%2BmWqw2W03l5gK3aN7621N9PQV6fmxfG92uxAcggAE0BwCQ5CIFQcxdFAjgSGAHKnGS6BwG6Ga5LCLAFGs6AWCw2BpNsNQRBw%2Bx1AAfOOdpBuWIjAr4YCVgAcrh%2BFCIg1DAPgAC%2BNYASAZAiGIpCEFwLBQBQNCCIJIqVLI%2BCZOgkBaEUBRIVONCSDA7A8BwHDEHAiAAPSGQJojiIQsJaIZMDoIZmDonAhnMIpEDKfaXSxIZ6ESqgSyoNA1o5M5SkqR5vi4MQYWgfoZDcugdRUnASGHseIAAMyEAAjAATLxXGAQ6EArAAYtAMAULJ1RgSAXFAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick uplanguage-serverIssues specific to our IDE integration rather than type checking

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions