Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setModuleCheckPolicy() breaks haxe server cache when targeting C# or Java #7652

Closed
jeremyfa opened this issue Dec 1, 2018 · 7 comments
Closed
Labels
bug feature-compiler-cache platform-cs Everything related to c# platform-java Everything related to Java

Comments

@jeremyfa
Copy link

jeremyfa commented Dec 1, 2018

On large codebases, I take advantage of --macro server.setModuleCheckPolicy() to improve code completion speed. It works fine with JS or C++ target, but breaks on C# target.

I reproduced the issue on a minimal project:

Main.hx

package;

import somepack.SomeClass;

class Main {

    static public function main():Void {

        trace("Hello World");
        
        var someInstance = new SomeClass();
        someInstance.hello('World');
      
    }
}

somepack/SomeClass.hx

package somepack;

class SomeClass {

    public function new() {
        //
    }

    public function hello(name:String) {
        trace('HELLO $name (SomeClass)');
    }

}

build.hxml

-cs out
-main Main
--macro server.setModuleCheckPolicy(['somepack'], [NoCheckShadowing, NoCheckDependencies], false)

Equivalent with js or cpp target works as expected, but completion server fails with C# target with errors:

Building Cache...
Parsing Classpaths...
Main.hx:3: characters 8-26 : Type name String is redefined from module String
Done.
[Error - 13:25:15] Request textDocument/completion failed.
  Message: Main.hx:3: characters 8-26 : Type name String is redefined from module String
  Code: -32603 
[Error - 13:25:18] Request textDocument/completion failed.
  Message: Main.hx:3: characters 8-26 : Type name String is redefined from module String
  Code: -32603 

Completion stops working at that stage.

Currently, I have no way to make code completion reasonably fast on large projects when targeting C# because of this issue.

@ncannasse
Copy link
Member

@jeremyfa are some other targets concerned or is it C#-specific?

@jeremyfa
Copy link
Author

jeremyfa commented Dec 1, 2018

@ncannasse After trying every other target I thought about, it works as expected on cpp, hl, js, lua, php and python targets, but breaks when targeting c# or java

@jeremyfa jeremyfa changed the title setModuleCheckPolicy() breaks haxe server cache when targeting C# setModuleCheckPolicy() breaks haxe server cache when targeting C# or Java Dec 1, 2018
@jeremyfa
Copy link
Author

jeremyfa commented Dec 1, 2018

Forgot to mention that the error is the same (Type name String is redefined from module String) on both C# and Java target

@RealyUniqueName
Copy link
Member

I cannot reproduce this with Haxe 4.0.0-rc.2 or latest development.

@jeremyfa
Copy link
Author

That's sounds like good news, I guess? Did this get fixed somehow?

@jeremyfa
Copy link
Author

I just tried to reproduce the issue again on Haxe 4.0.0-rc.2, and indeed I don't have the error anymore.

It doesn't seem to happen on rc.1 as well. It seems something has changed since when I posted this issue.

@Simn
Copy link
Member

Simn commented Jun 5, 2020

Looks like this is resolved.

@Simn Simn closed this as completed Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature-compiler-cache platform-cs Everything related to c# platform-java Everything related to Java
Projects
None yet
Development

No branches or pull requests

5 participants