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

[Bug]: No symbols found #157

Closed
Shtoyan opened this issue Jan 30, 2023 · 7 comments
Closed

[Bug]: No symbols found #157

Shtoyan opened this issue Jan 30, 2023 · 7 comments
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@Shtoyan
Copy link
Contributor

Shtoyan commented Jan 30, 2023

Describe the bug

After 0.6.0 symbols started to appear in Outline tab. But they behave quite strangely:

  • For some classes they just work fine and instantly.
  • For others it will warn you no symbols found in document and show nothing. It doesn't depend on a file size - huge hud files can work and small utility classes will bug out.

You can fix it by editing-saving the file or switching to other classes several times.

Screenshots

Not a screenshot but a short video demonstration: https://youtu.be/h22MRGMKCwI

@Shtoyan
Copy link
Contributor Author

Shtoyan commented Jan 30, 2023

And a little post scriptum: seems like extension parses the document for symbols on each file switch / reopen. Maybe change it, so it triggers only on file modification?

@EliotVU EliotVU added the enhancement New feature or request label Jan 30, 2023
@EliotVU
Copy link
Owner

EliotVU commented Jan 30, 2023

This could definitely be done better, but basically VSCode is waiting for the server to respond as it is still indexing all the dependencies, which is why it's sometimes not showing up, some classes have a dependency with even more dependencies, so it can take quite a while before it is able to respond to the symbols request.

You can see what the server is doing under "Output > UnrealScript" to confirm.

@EliotVU
Copy link
Owner

EliotVU commented Jan 30, 2023

I have two solutions for this that may make this more responsive:

  1. Respond as soon as the document has sufficient data to feedback the symbols data.
  2. As request, re-parse the entire document and just collect the symbols from the AST, bypassing the indexation of the document as we don't need any semantics here. This however is a bit wasteful :)

@EliotVU
Copy link
Owner

EliotVU commented Jan 30, 2023

And a little post scriptum: seems like extension parses the document for symbols on each file switch / reopen. Maybe change it, so it triggers only on file modification?

This was done by design to ensure that the server is working the correct up-to-date document, for instance if you open a document and make some unsaved changes, and proceed to close this document, the server will re-process the document without any of the unsaved changes.

Surely this can be optimized, but it is not crucial as it has almost no impact on performance.

@Shtoyan
Copy link
Contributor Author

Shtoyan commented Jan 31, 2023

What comes to my mind at first - cache everything in the workspace? Most of the files, especially the game source code that you make mods for, never change. So you can just check the md5-file date and use the cached dependency and symbol tree. It will speed up the startup and new file opening significantly.

But honestly, I don't know how it's done and what's the best practice / the easiest way to do it in VSCode, so up to you, I guess.

EliotVU added a commit that referenced this issue Feb 4, 2023
@EliotVU EliotVU closed this as completed in 93618bd Feb 8, 2023
@EliotVU
Copy link
Owner

EliotVU commented Feb 8, 2023

Yeah, but this is out of scope for now, as the current approach may still be changed drastically, it would be a lot of work to keep a persisted cache compatible.

I solved this by waiting for the document to be indexed before the server sends a result of symbols. This fixes the issue where a list of symbols never gets retrieved.

However this may still take (seconds) if the server is indexing multiple documents, this can definitely be improved on later, by responding right before indexing as we don't need the all the info that gets indexed.

@EliotVU EliotVU added the bug Something isn't working label Feb 8, 2023
@EliotVU EliotVU added this to the 0.6 milestone Feb 8, 2023
@Shtoyan
Copy link
Contributor Author

Shtoyan commented Feb 8, 2023

This fixes the issue where a list of symbols never gets retrieved.

This is fine too, I'm used to wait a little bit for indexing. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants