Skip to content

Autocompletion and #include improvements#53

Open
FalsePattern wants to merge 25 commits intormordechay:mainfrom
FalsePattern:pr3
Open

Autocompletion and #include improvements#53
FalsePattern wants to merge 25 commits intormordechay:mainfrom
FalsePattern:pr3

Conversation

@FalsePattern
Copy link
Copy Markdown
Contributor

@FalsePattern FalsePattern commented Mar 6, 2025

  • Fixed Vector index read error  #36 - Array index access of struct member vectors
  • Added support for multi-level recursive including of user types
  • Fixed relative include paths when including other files from different directories
  • Added support for Minecraft shaderpack "absolute path" includes
    With this one, something like #include "/foo.glsl" will walk up the file tree, looking for this directory: shaderpacks/<any directory name>/shaders/, and evaluates the absolute path as a child path of this directory
  • Fixed autocompletion of #version version number, and also added autocompletion for the core/compatibility/es version suffixes
  • Added cross-directory #include autocompletion
  • Added autocomplete for custom functions
  • Fixed autocomplete on lines in front of existing expression assignment statements
  • Fixed autocomplete inside unfinished statements
  • Support for sodium #import <sodium:include/fog.glsl> statement
    • Resolve path properly inside the mod
    • Able to search dependency mods
  • Making #import and #include clickable reference
  • Support for NV_gpu_shader5 pointers uint *data;
  • Fix bool assignements such as bool a = true==true;

Supersedes #47 (part 3 of 4)

Unfortunately I was not able to break up this batch of commits into even smaller PRs, as a lot of them depend on changes in preceding commits, and removing those cross-commit dependencies would make merging the split pull requests a pain.

@Lundis
Copy link
Copy Markdown

Lundis commented Mar 11, 2025

I'm looking very much forward to these improvements, but what happened to the .glsl_idea_root marker file you mentioned in the other PR? I read the code from my phone, and I'm unfamiliar with both the language and architecture, so maybe I just missed it? It would be great if instructions for either solutions were documented somewhere. Anyway thank you very much for your work 🙏

@FalsePattern
Copy link
Copy Markdown
Contributor Author

oops, i accidentally missed that commit while splitting up the PR, thanks for pointing it out!

(cherry picked from commit dc804ec)
(cherry picked from commit 938bcdf)
(cherry picked from commit caf06f5)
(cherry picked from commit 0ba4abc)
@FalsePattern
Copy link
Copy Markdown
Contributor Author

FalsePattern commented Jul 1, 2025

Sorry about taking so long to fix this pr, but the rebased version should work properly.

Commit 6f39fa8 slightly modifies the infinite recursion guard to work on the current chain of includes instead of a list of total encountered included files
This fixes the odd edge case of having a common utility file included in multiple separate files that are then included in a main file causing the type search to quit with a StopLookupException even if it's not actually an infinite recursion.

…ifferent nested includes

This makes patterns like this work:

/frag/main.glsl:
  #include "/common/utils.glsl"
  #include "/frag/lighting.glsl"
  ...

/frag/lighting.glsl:
  #include "/common/utils.glsl"
  ...
@FalsePattern
Copy link
Copy Markdown
Contributor Author

Any progress on this?

@FalsePattern
Copy link
Copy Markdown
Contributor Author

Additional changes by @drouarb:

  • Support for sodium #import <sodium:include/fog.glsl> statement
    • Resolve path properly inside the mod
    • Able to search dependency mods
  • Making #import and #include clickable reference
  • Support for NV_gpu_shader5 pointers uint *data;
  • Fix bool assignements such as bool a = true==true;

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.

Vector index read error

3 participants