Skip to content

Many fixes and improvements#24

Open
Pollux12 wants to merge 63 commits into
mainfrom
hotfix/various-fixes-scope-regression
Open

Many fixes and improvements#24
Pollux12 wants to merge 63 commits into
mainfrom
hotfix/various-fixes-scope-regression

Conversation

@Pollux12
Copy link
Copy Markdown
Owner

@Pollux12 Pollux12 commented May 1, 2026

Fix various issues

This branch became extremely bloated, but it fixes a ton of issues and completes the move to the new annotation repo as well.

Changes:

  • Add func to function default parameter mapping.
  • Add default GLua parameter type conversion.
  • Add strictTypeCoercion mode.
  • Add built-in std.Split support.
  • Add BaseClass support for panel classes.
  • Add ---@outparam tag support.
  • Add default value syntax support for optional parameters.
  • Add NULL entity support.
  • Improve dynamic fields for metatable-based objects.
  • Improve dynamic field completion, hover and go-to-definition.
  • Improve hover ordering and explicit realm display.
  • Improve scripted class dynamic field resolution.
  • Improve metatable inference.
  • Improve references, definitions, hover and implementations.
  • Improve performance for indexing and diagnostic phases.
  • Fix false positive undefined-field errors on numerically-indexed tables.
  • Fix false positive type mismatch errors on inherited class method parameters.
  • Fix false positives from nil checks and initialized table assignment chains.
  • Fix whitespace breaking table indexing.
  • Fix pairs() on exact tables losing key and value types.
  • Fix workspace overrides hiding documented library return types.
  • Fix TOOL files under lua/weapons/gmod_tool/stools/** being treated as SWEPs.
  • Fix SWEP default tool file exclusion being too broad and excluding unrelated files.
  • Fix scripted class file exclusions not being scoped correctly.
  • Fix nested NetworkVars not being detected in scripted classes.
  • Fix file-scoped dynamic fields leaking across files when globals are disabled.
  • Fix scripted_ents.GetMember(...) not carrying over NetworkVar accessors.
  • Fix startup-complete status being sent before initial workspace diagnostics finish.
  • Fix optional/default parameter type handling.
  • Fix type handling for self, locals and default members.
  • Fix floats in default parameter values being parsed as integers.
  • Fix duplicate outparam tags not being merged correctly.
  • Fix NULL not being removed after an IsValid check.
  • Fix inconsistent diagnostics caused by unstable type ordering.
  • Fix diagnostic flickering during analysis.
  • Fix fields default values not being treated as optional.

Pollux12 and others added 30 commits April 29, 2026 22:52
Not sure on the best way to really solve this, I think it's reasonable to assume that the base args for the wiki defined things aren't going to be changed / overridden, so we should instead merge or should meta version where possible for things like hover or type info
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removes old flow budget stuff that can cause issues with large files
Caches scripted scope scanning once per workspace
Cache and re-use function call infer data
This reduces a lot of noise false positives, but also can reduce the strictness of types. Default on, can be toggled off.
Precomputes workspace-wide facts so common diagnostics can skip full-tree scans when nothing relevant can fire.

Shares the same candidate lists and prefix events across checkers instead of rebuilding them per file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes call, export, and generic mismatch checks. Fixes various exact field lookups as well.
Preserve metatable instances and table-backed aliases when resolving dynamic fields.

Keeps hover, definition, completion, and diagnostics on the inferred override from the original annotated version, while also allowing for changes in parameters etc...

Could cause some false positives where heavy overrides are used, with the shape being changed completely, although I doubt many are completely changing base gmod functions.
@Pollux12 Pollux12 marked this pull request as ready for review May 18, 2026 11:23
Copilot AI review requested due to automatic review settings May 18, 2026 11:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@Pollux12 Pollux12 changed the title Hotfix/various fixes scope regression Many fixes and improvements May 18, 2026
It is technically valid to have it in both cl_init and init, even though you really should not
@Pollux12 Pollux12 self-assigned this May 18, 2026
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.

2 participants