Auto completion for references works only partially #23
Comments
How can a target need be present in multiple files? Is this because of some sort of variant management, so that during build time only one need-target file gets used? However, as this information is coming from |
Example: 2 needs of type "req", one in "file_1.rst" and the other one in "file_2.rst". This is not supported. |
Yes, this is what I meant. You just need two "reqs" in two different files and not in the same file and the feature does not work |
Hi @twodrops, I tested it the above issue you mentioned. It works fine for me. Here is the test scenario I had: 2 needs of type "req" in different rst file: need REQ_1 in index.rst, need REQ_2 in test.rst. As you can see from the pictures below:
One possible explanation for your issue, might be needs.json. Could you please check your "_build/needs/needs.json" for example? Is your needs.json contains those needs you expected? |
I checked the needs and I can see that I have all the required needs present there. It must then be something else that is causing this. We can do some live testing with my example in our telco today :) |
Hi @twodrops, After thoroughly investigation, I finally identified the issue, which has nothing to do with auto completion or needls. The auto completion issue you experienced is because needs.json not got loaded. The reason that needs.json not loaded is because it failed to load declared needs_types from conf.py. The reason why it failed to load needs_types from conf.py is because:
This is also the reason why it works for me locally at the first place when I didn't test the sphinx-needs-basics repo. Potential fix in the future might be to introduce another setting to get needs_types from conf.py. |
@haiyangToAI Thanks for finding out the root cause. I suppose it was not all that easy to come to that conclusion. Great! |
Problem solved and |
Auto completion of references using
->
>
works only if the target element is coming from a single file. If the target is present in multiple files or in multiple folders, auto-completion works only till the folder listing (no files or IDs under the folders are offered) .No errors are thrown.
The text was updated successfully, but these errors were encountered: