Skip to content

Add support for type definition - #645

Merged
krassowski merged 6 commits into
python-lsp:developfrom
Hoblovski:feat/type_definition
Jul 4, 2025
Merged

Add support for type definition#645
krassowski merged 6 commits into
python-lsp:developfrom
Hoblovski:feat/type_definition

Conversation

@Hoblovski

Copy link
Copy Markdown
Contributor

Description

Using jedi's infer to support checking type definition.
The same approach is used by jedi-language-server.

This PR, combined with smheidrich's Goto Implementation PR, should fixissue 97.

Also added some unit tests.

@krassowskikrassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, thank you!

Comment threadCONFIGURATION.md Outdated
Comment threadtest/plugins/test_type_definition.py Outdated
Comment threadpylsp/plugins/type_definition.py Outdated
Comment threadtest/plugins/test_type_definition.py Outdated
@Hoblovski

Hoblovski commented May 13, 2025

Copy link
Copy Markdown
ContributorAuthor

Renamed plugin to *jedi_*type_definition, removed debug lines, fixed copyright lines.

Oops... Force push to fix the ruff errors.

@Hoblovski
Hoblovskiforce-pushed the feat/type_definition branch from eb5fc48 to c516911CompareMay 13, 2025 13:02
@Hoblovski
Hoblovskiforce-pushed the feat/type_definition branch from c516911 to 75f6234CompareMay 13, 2025 13:05
Hoblovski added a commit to cloudwego/abcoder that referenced this pull request May 15, 2025
Custom pylsp is based on [python-lsp-server](https://github.com/python-lsp/python-lsp-server), and plus the following pull requests:
1. semanticTokens/full: python-lsp/python-lsp-server#645
2. typeDefinition: python-lsp/python-lsp-server#533
Maybe also
3. implementation: python-lsp/python-lsp-server#644
@krassowski

Copy link
Copy Markdown
Member

The linter is suggesting to move the line in config table so that they are neatly sorted:

Run python scripts/jsonschema2md.py pylsp/config/schema.json EXPECTED_CONFIGURATION.md
35a36
> | `pylsp.plugins.jedi_type_definition.enabled` | `boolean` | Enable or disable the plugin. | `true` |
45d45
< | `pylsp.plugins.jedi_type_definition.enabled` | `boolean` | Enable or disable the plugin. | `true` |

@krassowskikrassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, but I will wait with merge to let other maintainers take a look too.

@krassowskikrassowski changed the title Feat/type definitionAdd support for type definitionJul 4, 2025
@krassowski
krassowski merged commit 5480e5d into python-lsp:developJul 4, 2025
10 checks passed
@krassowskikrassowski added this to the v1.13.0 milestone Jul 4, 2025
@ccordoba12ccordoba12 added the enhancement New feature or request label Jul 7, 2025
Hoblovski added a commit to cloudwego/abcoder that referenced this pull request Jul 25, 2025
Hoblovski added a commit to cloudwego/abcoder that referenced this pull request Jul 30, 2025
simuleite pushed a commit to simuleite/abcoder that referenced this pull request Feb 28, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to run lsp-goto-type-definition and lsp-goto-implementation.

3 participants

@Hoblovski@krassowski@ccordoba12