Closed RobbyCBennett closed 8 months ago
@groke and @HeidiJoe I'm done with the coding part of this issue. I'm just waiting for the blue checkmark and also to publicize this repo.
Okay. We are verified.
However, I just thought of another thing that probably should happen before a release. I've added it to the list.
I don't know if I should spend the time to add "Automatically analyze all files or prompt on project config changed" right now. It seems that even Understand doesn't have a pop up for this when opening the project. It's just for when the GUI closes and it checks the config diff right there.
@katescitools will you please test Understand for VS Code? It's an extension for VS Code. All of the features to test are in the README.md and lots of other info is there, like setup and FAQ.
@groke I don't know if Kate has access to this repo right now.
I've added the Understand team to this repo now.
Hi @RobbyCBennett , I'm assuming that the test focuses only in VS Code and nothing in Understand since the Beta Release description mentioned that 'This plugin displays Understand errors, warnings, CodeCheck results, references, and hover information in VS Code.' Is that correct?
I installed VS Code and the understand.vsix in VS Code but I have some clarifications below. For example: (I put numbering so you can reply easily but below are just sample questions on my end as I'm not yet able to imagine the whole picture of this task)
Add all features to documentation
- Are we pertaining to this documentation below? Are we supposed to see them in the help file of Understand? https://github.com/stinb/UnderstandForVSCode/blob/main/README.md
Fix code action lightbulb on wrong line (actually, the lightbulb is supposed to be above, but the happens with left-clicking anywhere but the left of the token because the client is inconsistent with sending back diagnostics)
This is a sample of lightbulb I'm seeing in VS Code after installing the extension, is this what you're referring to? Note that I'm using the source code zip file from this: https://github.com/stinb/UnderstandForVSCode/releases/tag/v0.9.2-beta and fastgrep project to test this
I would appreciate if you can share any file you're using to work on this so we can have same reference as I'm not sure if the current project I'm using is enough to test this.
Curious too if we're strict with the lightbulb color as I can sometimes see yellow, sometimes blue camouflaging the code:
- Make sure that references and others have commands
- 4.1what commands are we referring to? Do we have a list for this? For example, here's a reference list I saw, what commands are we expecting here?
This is what I sometimes see:
and this: (Curious if it's expected for the right context menu to be different depending on the project?)
Use setContext to make a new context called understandFile to narrow down available commands
- Is this QA applicable for testing? Or only for developers hence out of scope for testing? If covered in testing, can you provide more info about setContext.
Remove duplicate violations (https://github.com/stinb/sti/issues/3146)
- I've not observed duplicate violations when I tested using Fastgrep project. Looks like this one is working fine.
Wait for the verified blue checkmark on the marketplace (should be at latest Tuesday, Feb 6)
- No verified blue mark on my end: (We're supposed to see it in the extension part of VS Code right?
Automatically analyze all files or prompt on database wrong version
- should the automatic analysis start upon project opening? I'm not seeing one when I opened a new project. Also, do we have a way to know when it was last analyzed to confirm that it was indeed analyzed?
Automatically analyze all files or prompt on project config changed
- How is this happening? Is this about the analysis happening after I modify and save the changes?
- This is what I'm seeing first upon opening fastgrep.und and I wasn't really able to see an analysis showing after opening the project:
Or is this making sure that it is already connected to Understand?:
@katescitools Thanks for your thorough comment.
I would appreciate if you can share any file you're using to work on this so we can have same reference as I'm not sure if the current project I'm using is enough to test this.
Here are copies of some of the sample projects that I've already made and configured with some background CodeChecks. Once you have projects, VS Code is the only program that is needed to be opened.
Hi @RobbyCBennett , I'm assuming that the test focuses only in VS Code and nothing in Understand since the Beta Release description mentioned that 'This plugin displays Understand errors, warnings, CodeCheck results, references, and hover information in VS Code.' Is that correct?
Yes, the main part of this is to be done only in VS Code. However, under "Setup: Project Creation" in README.md, it says that projects need to be created and configured with CodeCheck outside of VS Code.
I'm not yet able to imagine the whole picture of this task.
Sorry that I wasn't very clear about what I wanted to be tested. I should have made a fresh issue to avoid confusion.
The checklist at the top of this issue was just intended for things for me to do to polish this product before releasing it. I just wanted you to test the features listed in the readme file. Here they are with simplified descriptions of the main things to look for.
Answers to the numbered questions:
1 That wans't meant for testing. Unimportant detail: the word "context" isn't in package.json anymore.
2 Yes, that is the readme file that users will see. The hope is that the readme file has clear information to help a user to set up for the first time, set up some projects, and learn about the features.
3 Yes, that's the lightbulb. I agree that the lightbulb color should be consistent. The color is one of the things that VS Code controls. It seems to be yellow normally and blue when there are ignores/fixes.
4.1 The easiest way to see commands is with the command palette. I was just adding commands that start with "Understand: References:". There are 12 commands. They are duplicates of the things you see when right-clicking such as "Go to Definition".
4.2 Yes, you should be able to see all of those, but only if you see the following on the bottom status bar.
The reason that you see some of those in your first example is because you don't have a .und project and also because that's a markdown file. Some other extension has added those references to the markdown file. We don't support the markdown language. You see all 12 commands in regexp.h because there's a .und folder and C is a language we support.
4.3 That wasn't meant for testing.
5 That wasn't meant for testing.
6 Great. I don't expect to have any dupilcates.
7 Correct. There's no blue checkmark on the extension because you installed it from a file. Once we publish it, users can install it from the marketplace and a blue checkmark will show. This is because I have already verified our publisher account.
8 It should start automatically analyzing if there's a .und project, you open a code file, and the project has not been analyzed after the last change. Your FastGrep project probably was already analyzed, and your UnderstandForVSCode project didn't have a .und folder. Therefore, you didn't see an automatic analysis.
9 I'm not adding that feature right now. Understand doesn't even have that feature to see config changes during project opening. What you stumbled upon is VS Code's worst feature: arbitrary code execution. Sorry I forgot to tell you about it. It's a terrible popup, and I recommend you disable it. Go to settings with the command "Preferences: Open User Settings".
task.allowAutomaticTasks
to "off"security.workspace.trust.enabled
10 Yes, this means that the status bar icon should show Understand with the magnifying lens icon. This means that the extension is working and it gives the user the power to understand their code.
Thanks a lot for the info you provided, @RobbyCBennett ! You gave a very detailed information and I appreciate that a lot, really!!! :)
Kindly see below for the test continuation: Note that there are pending clarification/failed items as I need a confirmation if they are a valid bug or expected. :)
Actual:
Expected based on your screenshot:
I'm also not sure if we're strict with the order they are shown. For example, on my end, Analyze is the first option for the user to see, but in your screenshot, I'm seeing 'Select .und projects' as the first option.
https://github.com/stinb/UnderstandForVSCode/assets/106690270/e79d599b-1766-443f-90cd-84db4b46304e
This is Understand's hover info using the same entity:
https://github.com/stinb/UnderstandForVSCode/assets/106690270/90099ce2-0e9f-4d10-8600-09991f96e8b8
Quickly Analyze Your Code (analyze automatically on save or manually) (PASSED)
Explore in Understand (able to go into a file in Understand from VS Code) (PENDING/ FAILED)
Understand's command palette is observed with 12 commands. (PASSED)
PS. I followed the instructions you gave for the settings and that worked! Thank you!
The behavior is expected, but I'll fix the screenshot. I removed "Explore current file in Understand" from that menu because it doesn't work well for unresolved files, and I don't like having an inconsistent menu.
Here are some examples. I'll fix this by adding some info into the readme.
TheAlgorithms/DataStructures/HashMap/Hashing/HashMap.java
the object buckets
has a type definition of LinkedList
but hsize
has no type definition because int
is a primitive type.TheAlgorithms/DataStructures/DynamicArray/DynamicArray.java
the type Iterable
has 2 different implementing classes that we can see. There's also another one that's compressed and we don't currently show compressed files in VS Code.regexp.c
the function regcomp
has a declaration in the header file regexp.h
.That's currently the expected behavior. I made it that way to conform to how other language servers work, especially C/C++ ones. I agree that it looks redundant right there at the declaration/definition, but it actually is helpful elsewhere. However, I think that a user should be able to configure exactly what they see. I'll make an issue for this https://github.com/stinb/UnderstandForVSCode/issues/3.
Right now, the user is supposed to analyze afterward. I see how confusing this is, so I'll add to the readme and add an issue to automatically analyze with ignores/fixes https://github.com/stinb/UnderstandForVSCode/issues/4.
It looks like there's an easy fix for that, so I'll fix that now so that it starts automatically if there's a .und folder and also add to the readme.
This isn't a limitation of VS Code or my extension. The cause is either the OS or maybe Understand. My extension behaves just like launching Understand from a terminal. I'll make an issue about this. https://github.com/stinb/sti/issues/3156
Great!
I made some documentation here for anyone else who will test this and wants to avoid the annoying popup too.
It also says that we should never open a .code-workspace file that we didn't create because they can enable arbitrary code execution and then immediately execute arbitrary code.
Wow thank you so much for all the feedback from the testing! I appreciate you creating the issues as you confirm them too. I've checked item 2 above for the Go To Implementations, Type Definition, and Declaration and I was able to see them working in VS Code.
Since there are already separate issues for the other items that need fix, I'll just wait for item 5 and retest once the fix for that is available.
When fix becomes available for item 5, I'll re-assign this to you for you to close or continue with the other unselected checkboxes. Thanks again, @RobbyCBennett !
Okay, @HeidiJoe. This extension is ready for the next person to test. You mentioned someone specific to test it.
Here's the link to all of the releases of the extension, with the latest one showing first.
Also, the tester should probably read this to avoid any frustrations with VS Code.
@RobbyCBennett I made the repo public to help with some testing issues.
Okay. Since you did that, I just fixed the README so that the images are visible in the editor. That's only possible when the repo is public. I released it as 0.9.4, which is the latest beta release right now.
Now it's fixed again, for real, in case you downloaded it in the last 6 minutes.
I will release to the VS Code extension marketplace once we push our next release of Understand.
Published
scitools
setContext
to make a new context calledunderstandFile
to narrow down available commandsbaseImagesUrl
from Makefile and wiki