Sarrus1 / sourcepawn-studio

VSCode extension for SourcePawn scripting
https://sarrus1.github.io/sourcepawn-studio/
MIT License
143 stars 22 forks source link

Nested relative include paths can't be resolved by linter #311

Closed KitRifty closed 1 year ago

KitRifty commented 1 year ago

Basic informations

Further Information

The linter can't resolve relative include paths for nested files. However this shouldn't be an issue since spcomp resolves them just fine and compiles successfully.

Code to reproduce the behaviour

test.sp:

#include <sourcemod>
#pragma newdecls required
#pragma semicolon 1

#include "test/file1.sp"

public void OnPluginStart()
{
    TestFunc();
    InnerTestFunc();
}

test/file1.sp:

#pragma newdecls required

#include "test2/file1.sp"

void TestFunc()
{
}

test/test2/file1.sp:

#pragma newdecls required

void InnerTestFunc()
{
}

Expected behaviour

No error.

Error messages

image

EDIT: My SourcePawn Doctor output

image

Not related, but the errors about spcomp's path can be ignored since I added spcomp to PATH. Compilation still works.

EDIT 2: When using angled brackets instead of quotes for the relative include statements (#include <test2/file1.sp>), the error goes away. However, the code is not compilable leading to more inconsistent behaviour.