Coder Social home page Coder Social logo

Comments (7)

Shtoyan avatar Shtoyan commented on July 22, 2024

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?

from unrealscript-language-service.

EliotVU avatar EliotVU commented on July 22, 2024

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.

from unrealscript-language-service.

EliotVU avatar EliotVU commented on July 22, 2024

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

from unrealscript-language-service.

EliotVU avatar EliotVU commented on July 22, 2024

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.

from unrealscript-language-service.

Shtoyan avatar Shtoyan commented on July 22, 2024

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.

from unrealscript-language-service.

EliotVU avatar EliotVU commented on July 22, 2024

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.

from unrealscript-language-service.

Shtoyan avatar Shtoyan commented on July 22, 2024

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!

from unrealscript-language-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.