Skip to content

Comments

Go to definition improvements#78

Open
cgtudor wants to merge 8 commits intoPhilippeChab:migrate-nwnsc-to-nwn-script-compilerfrom
cgtudor:go-to-definition
Open

Go to definition improvements#78
cgtudor wants to merge 8 commits intoPhilippeChab:migrate-nwnsc-to-nwn-script-compilerfrom
cgtudor:go-to-definition

Conversation

@cgtudor
Copy link

@cgtudor cgtudor commented Feb 11, 2026

This is built on top of #77 but I can't set that as the base branch on this repo.

This PR accomplishes the following:

  • Go to definition (for functions) now works even if the function doesn't have a forward declaration (as long as the file it lives in is included, of course).
  • If a function has both a forward declaration and a declaration with a body, go to definition now jumps to the function with a body instead of the forward declaration. If there is only a declaration without body (like nwscript.nss functions) it will jump to them still.
    • This is set as default behaviour but can be turned off (returning to the previous behaviour) in the vscode user settings with "nwscript-ee-lsp.definition": { "preferImplementation": false }

@cgtudor cgtudor mentioned this pull request Feb 11, 2026
@cgtudor cgtudor force-pushed the go-to-definition branch 3 times, most recently from 8ecc74b to dc96770 Compare February 13, 2026 13:01
@cgtudor cgtudor force-pushed the go-to-definition branch 2 times, most recently from f569ffa to 9a2e40f Compare February 13, 2026 14:05
Now, we prioritize functions with bodies and only jump to forward declaration if no full function was found. This also means there's no reason for forward declarations anymore.
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.

1 participant