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

Cannot rename methods in a class #29467

Closed
nadeeshaan opened this issue Mar 23, 2021 · 3 comments · Fixed by #29788
Closed

Cannot rename methods in a class #29467

nadeeshaan opened this issue Mar 23, 2021 · 3 comments · Fixed by #29788
Assignees
Labels
Area/Rename Language Server Rename related issues Area/SemanticAPI Semantic API Related Issues #Compiler Priority/Blocker SwanLakeDump All issues planned for Swan Lake GA release Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Bug Version/SLAlpha3 Issues reported on SwanLake Alpha3 release, mostly reported from the usability hackathon

Comments

@nadeeshaan
Copy link
Contributor

Description:
Consider the following source snippet and try renaming the poll method

class FinnHubTradesSubsriber {
    private ws:Client wsClient;
    private decimal pollInterval;
    private boolean proceed = false;

    function init(ws:Client wsClient, decimal pollInterval) {
        self.wsClient = wsClient;
        self.pollInterval = pollInterval;
    }

    public function poll(string symbolName) {
        
    }

    public function stop() {
        io:println("interrupted!");
        self.proceed = false;
    }
}
@nadeeshaan nadeeshaan added Type/Bug Team/LanguageServer Language Server Implementation related issues. #Compiler Priority/Blocker Version/SLAlpha3 Issues reported on SwanLake Alpha3 release, mostly reported from the usability hackathon Area/Rename Language Server Rename related issues labels Mar 23, 2021
@pubudu91 pubudu91 added the Area/SemanticAPI Semantic API Related Issues #Compiler label Mar 24, 2021
@nadeeshaan nadeeshaan added the SwanLakeDump All issues planned for Swan Lake GA release label Mar 24, 2021
@nadeeshaan nadeeshaan self-assigned this Mar 24, 2021
@nadeeshaan nadeeshaan added this to To do in Sprint 28 - Language Support Virtual Team via automation Mar 24, 2021
@nadeeshaan nadeeshaan added this to the Ballerina Swan Lake - Beta milestone Mar 24, 2021
@pubudu91
Copy link
Contributor

#29578 may be related to this.

@nadeeshaan
Copy link
Contributor Author

In master, we get the following for starters

'class io.ballerina.compiler.api.impl.symbols.BallerinaMethodSymbol cannot be cast to class io.ballerina.compiler.api.impl.symbols.BallerinaSymbol (io.ballerina.compiler.api.impl.symbols.BallerinaMethodSymbol and io.ballerina.compiler.api.impl.symbols.BallerinaSymbol are in unnamed module of loader 'app')'}
java.lang.ClassCastException: class io.ballerina.compiler.api.impl.symbols.BallerinaMethodSymbol cannot be cast to class io.ballerina.compiler.api.impl.symbols.BallerinaSymbol (io.ballerina.compiler.api.impl.symbols.BallerinaMethodSymbol and io.ballerina.compiler.api.impl.symbols.BallerinaSymbol are in unnamed module of loader 'app')
	at io.ballerina.compiler.api.impl.BallerinaSemanticModel.getInternalSymbol(BallerinaSemanticModel.java:337)
	at io.ballerina.compiler.api.impl.BallerinaSemanticModel.references(BallerinaSemanticModel.java:176)
	at org.ballerinalang.langserver.util.references.ReferencesUtil.lambda$getReferences$0(ReferencesUtil.java:85)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.ballerinalang.langserver.util.references.ReferencesUtil.getReferences(ReferencesUtil.java:84)
	at org.ballerinalang.langserver.util.rename.RenameUtil.rename(RenameUtil.java:54)
	at org.ballerinalang.langserver.BallerinaTextDocumentService.lambda$rename$12(BallerinaTextDocumentService.java:488)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

@nadeeshaan nadeeshaan assigned dulajdilshan and unassigned nadeeshaan and IMS94 Mar 25, 2021
@pubudu91 pubudu91 moved this from To do to Plan for This sprint in Sprint 28 - Language Support Virtual Team Mar 29, 2021
@dulajdilshan dulajdilshan moved this from Plan for This sprint to In progress in Sprint 28 - Language Support Virtual Team Mar 29, 2021
@pubudu91 pubudu91 modified the milestones: Ballerina Swan Lake - Beta, Ballerina Swan Lake - Beta RC1 Mar 29, 2021
@pubudu91
Copy link
Contributor

This is possibly the same as #28388. @dulajdilshan Can you verify #28388 as well once you fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Rename Language Server Rename related issues Area/SemanticAPI Semantic API Related Issues #Compiler Priority/Blocker SwanLakeDump All issues planned for Swan Lake GA release Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Bug Version/SLAlpha3 Issues reported on SwanLake Alpha3 release, mostly reported from the usability hackathon
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants