Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP: make use of pytest-lsp to start testing some core features #25011

Merged
merged 29 commits into from
May 8, 2024

Conversation

DanilaFe
Copy link
Contributor

@DanilaFe DanilaFe commented May 7, 2024

The title about says it all. This adds pytest-lsp to the chplcheck-requirements.txt file (which effectively is the chapel-py-requirements.txt at this point), and adds a new Makefile target to run the tests. It also locks down go-to-definition, autocompletion, and reference finding.

Reviewed by @jabraham17 -- thanks!

DanilaFe added 18 commits May 2, 2024 16:43
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Copy link
Member

@jabraham17 jabraham17 left a comment

Choose a reason for hiding this comment

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

🎉

Makefile.devel Outdated Show resolved Hide resolved
third-party/chpl-venv/chplcheck-requirements.txt Outdated Show resolved Hide resolved
Comment on lines +7 to +8
pytest==8.2.0
pytest-lsp==0.4.1
Copy link
Member

Choose a reason for hiding this comment

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

This makes me pause a little. Why are we now requiring all users of cls/chplcheck to have dependencies that are only used for development testing purposes.

In my opinion, these should be in a separate venv (like test-venv). Maybe chapel-py-test-venv?

tools/chpl-language-server/test/test_server.py Outdated Show resolved Hide resolved
tools/chpl-language-server/test/test_server.py Outdated Show resolved Hide resolved
tools/chpl-language-server/test/test_server.py Outdated Show resolved Hide resolved
tools/chpl-language-server/test/test_server.py Outdated Show resolved Hide resolved
tools/chpl-language-server/test/test_server.py Outdated Show resolved Hide resolved
DanilaFe added 11 commits May 8, 2024 09:49
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
Signed-off-by: Danila Fedorin <[email protected]>
@DanilaFe DanilaFe merged commit 60c2a84 into chapel-lang:main May 8, 2024
8 checks passed
@jabraham17 jabraham17 mentioned this pull request May 10, 2024
jabraham17 added a commit that referenced this pull request May 20, 2024
Expands the work of @DanilaFe in
#25011 to add more tests of
CLS, Chapels language server implementation.

Infrastructure changes
- Moved test-only python dependencies into their own venv
- Refactored and split up the monolithic `test_server.py`
- all top level python files are considered test files, helper files can
be hidden in sub directories
- this also allows for tests to be defined in multiple files to
logically group them

Added tests for the following features
- Resolving nested directories
- resolution tests
- call inlays
- type inlays
- diagnostics
- param inlays
- document symbols
- end markers
- code lenses (show generic, show instantiation)

Bugs fixed as a result of writing tests
- goto-type-def should use `name_location` when possible
- fix type inlay bug with implicit this
- fix document symbols inconsistencies
- fix off-by-one location error
- fix end marker inlays rendering incorrectly
- fix type variable locations

[Reviewed by @DanilaFe]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants