-
Notifications
You must be signed in to change notification settings - Fork 110
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
Syntax highlight in hover #1336
Conversation
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
LGTM. Thanks for the contribution. Please sign the CLA, fix the test cases in CI and I will merge this PR. |
I have read the CLA Document and I hereby sign the CLA |
@Peefy I was writing test for above code but I realised that I have to change tests for decorators, functions. But the problem with this is that the classifications I have done for these(except schema and attributes) don't cover all the cases. This will result in me writing some make-do tests for these and the person working after me will have to do extra work of removing those test-cases and then writing the correct code. Therefore, I was thinking if I should get the correct highlight for all data-types mentioned(Value and Decorators) and then writing test cases for the correct ones. Or should I just stick to original work. |
If you could add the correct display and testing for all hover content, that would be great. Unable to merge the PR in case of testing errors. |
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
No. If all tests pass in CI. I'll merge this PR. |
Pull Request Test Coverage Report for Build 9174095710Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
@Peefy All tests except hover::tests::dict_key_in_schema(which was added an hour ago) are passing in previous run. Should I change this test as well? |
Yes, thank you! 😄 |
Signed-off-by: Wck-iipi <110763795+Wck-iipi@users.noreply.github.com>
Done @Peefy |
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
2. What is the scope of this PR (e.g. component or file name):
/tools/src/LSP/src/hover.rs
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
It provides syntax highlight to hover text. It does so by using MarkedString::LanguageString and MarkedString::String.
This fixes the formatting as seen below.
![image](https://private-user-images.githubusercontent.com/110763795/332092514-a3cdc35e-bb03-46f1-8ba4-32dfe90db922.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNzAwNDksIm5iZiI6MTcyMDA2OTc0OSwicGF0aCI6Ii8xMTA3NjM3OTUvMzMyMDkyNTE0LWEzY2RjMzVlLWJiMDMtNDZmMS04YmE0LTMyZGZlOTBkYjkyMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNFQwNTA5MDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hZDE1MWZlZDU4NDA2ZDE0MmJkMzIzNTJjZTQ1OWE2YjRhYmM1YmE4OGU1YWE2MmQ1M2MxZGNjYjY3N2Q1Zjg1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.pfCjS7N7ELt16yqw8APJFpAeN-5EnA-3DIO7v5ugOG0)
However, this has a problem. It doesn't work on neovim unless you set the language as "kwt" instead of kcl. Therefore, please check if this is case for you as well.
![image](https://private-user-images.githubusercontent.com/110763795/332094324-b266555d-3c6a-4700-a2e6-a2641c98c6ae.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNzAwNDksIm5iZiI6MTcyMDA2OTc0OSwicGF0aCI6Ii8xMTA3NjM3OTUvMzMyMDk0MzI0LWIyNjY1NTVkLTNjNmEtNDcwMC1hMmU2LWEyNjQxYzk4YzZhZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNFQwNTA5MDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xZjk0M2I0OGZiMGY0ZjA2YmMyZjYyYmQ2Njc1NDM5ZjU5YTRlMmI0OTAzNzUxODVmMjkyMTViOWViMDFmNDAzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.MCxqXnyrzV2f5dsfCv5EmWA4YbWvg6whMlz8LaSYFOQ)
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:
I have currently not written tests for this. Please tell me if this is the right solution and then I will write the test cases.