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

Enhancement: Add example highlight hover content for the schema definition doc #1828

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Siddhi-agg
Copy link

@Siddhi-agg Siddhi-agg commented Jan 16, 2025

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):

kcl/kclvm/tools/src/LSP/src/hover.rs
kcl/kclvm/tools/src/LSP/src/test_data/hover_test/schema_with_examples.k

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

@Siddhi-agg Siddhi-agg marked this pull request as draft January 16, 2025 18:48
@Siddhi-agg
Copy link
Author

@Peefy When I run make test on the main branch of the project, I see the following test failures:

failures:
    completion::tests::complete_unimport_schemas
    completion::tests::import_external_pkg_test
    completion::tests::var_completion_test
    hover::tests::assignment_ty_in_lambda_hover
    hover::tests::complex_select_hover
    hover::tests::decorator_hover
    hover::tests::expr_after_config_if_hover
    hover::tests::func_def_hover
    hover::tests::import_pkg_hover
    hover::tests::inherit_schema_attr_hover
    hover::tests::lambda_doc_hover_test
    hover::tests::schema_attr_hover_test
    hover::tests::schema_doc_hover_test1
    hover::tests::schema_scope_variable_hover
    hover::tests::str_var_func_hover
    tests::complete_import_external_file_e2e_test
    tests::konfig_completion_test_main
    tests::konfig_goto_def_test_base
    tests::konfig_goto_def_test_main
    tests::konfig_hover_test_main
    tests::pkg_mod_test
    tests::rename_test
    tests::test_lsp_with_kcl_mod_in_order

test result: FAILED. 157 passed; 23 failed; 0 ignored; 0 measured; 0 filtered out; finished in 15.02s

Even after running the tests on the branch with my changes, these tests are still failing, and the new test I added also fails. Could this be an issue with my setup, or is there another reason for these failures? Any guidance would be greatly appreciated!

@Peefy Peefy requested review from He1pa and zong-zhe January 17, 2025 02:39
@He1pa
Copy link
Contributor

He1pa commented Jan 17, 2025

which your cargo and rust version

@Siddhi-agg
Copy link
Author

Rust version: rustc 1.84.0 (9fc6b4312 2025-01-07)
Cargo version: cargo 1.84.0 (66221abde 2024-11-19)

@Siddhi-agg Siddhi-agg changed the title Add example highlight hover content for the schema definition doc and… Enhancement: Add example highlight hover content for the schema definition doc Jan 18, 2025
@Siddhi-agg Siddhi-agg marked this pull request as ready for review January 18, 2025 15:19
@Siddhi-agg
Copy link
Author

Siddhi-agg commented Jan 18, 2025

@He1pa @Peefy @zong-zhe
I see that one of the tests in the CI failed. When I run the tests in my local machine, several of them are still failing (most of them are bench mark tests and failing because of that) including the one which failed here. The output for the konfig_hover_test_main when I run it individually is:


running 1 test
test tests::konfig_hover_test_main ... FAILED

successes:

successes:

failures:

---- tests::konfig_hover_test_main stdout ----
thread 'tests::konfig_hover_test_main' panicked at tools\src\LSP\src\compile.rs:175:10:
called `Result::unwrap()` on an `Err` value: Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." }
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::result::unwrap_failed
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\result.rs:1654
   3: enum2$<core::result::Result<std::path::PathBuf,std::io::error::Error> >::unwrap
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\result.rs:1077
   4: kcl_language_server::compile::compile_with_params
             at .\src\compile.rs:173
   5: kcl_language_server::tests::konfig_hover_test_main
             at .\src\tests.rs:1983
   6: kcl_language_server::tests::konfig_hover_test_main::closure$0
             at .\src\tests.rs:1973
   7: core::ops::function::FnOnce::call_once<kcl_language_server::tests::konfig_hover_test_main::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   8: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    tests::konfig_hover_test_main

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 180 filtered out; finished in 0.61s

error: test failed, to rerun pass `-p kcl-language-server --lib`

 *  The terminal process "C:\Users\ASUS\.cargo\bin\cargo.exe 'test', '--package', 'kcl-language-server', '--lib', '--', 'tests::konfig_hover_test_main', '--exact', '--show-output'" terminated with exit code: 101. 
 *  Terminal will be reused by tasks, press any key to close it. 

I looked at the CI's output for the failed test and added the missing Examples doc to the test and still got the same output I attached above.
Also, I couldn't locate the main.k file for the test, is is generated via code?

Signed-off-by: Siddhi Agrawal <[email protected]>
@Peefy
Copy link
Contributor

Peefy commented Jan 19, 2025

Hello @Siddhi-agg This is a git submodule. You can update the submodule to get test cases.

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.

[Enhancement] Add example highlight hover content for the schema definition doc.
3 participants