Code Monkey home page Code Monkey logo

Comments (7)

fwcd avatar fwcd commented on May 23, 2024

This might be related:

Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
	at java.util.Arrays.copyOfRange(Arrays.java:3664)
	at java.lang.String.<init>(String.java:207)
	at java.lang.String.substring(String.java:1969)
	at java.lang.String.subSequence(String.java:2003)
	at kotlin.text.StringsKt__StringsKt.commonPrefixWith(Strings.kt:775)
	at kotlin.text.StringsKt__StringsKt.commonPrefixWith$default(Strings.kt:765)
	at org.javacs.kt.position.PositionKt.changedRegion(position.kt:95)
	at org.javacs.kt.CompiledFile.oldOffset(CompiledFile.kt:114)
	at org.javacs.kt.CompiledFile.parseAtPoint(CompiledFile.kt:72)
	at org.javacs.kt.signatureHelp.SignatureHelpKt.signatureHelpAt(signatureHelp.kt:22)
	at org.javacs.kt.KotlinTextDocumentService.signatureHelp(KotlinTextDocumentService.kt:128)
	at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:61)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint$$Lambda$35/698288148.apply(Unknown Source)

from kotlin-language-server.

apatrida avatar apatrida commented on May 23, 2024

Is incremental compilation needed for code completion or for what purpose? How does the kotlin-web-demo handle completion?

https://github.com/JetBrains/kotlin-web-demo/tree/master/versions/1.2.50/src/main/java/org/jetbrains/webdemo/kotlin/impl

from kotlin-language-server.

fwcd avatar fwcd commented on May 23, 2024

@apatrida Each file needs to be compiled to an abstract syntax tree by the Kotlin compiler frontend. Using the AST, the language server can provide document symbols, code completion, hover and more.

The naive solution to this problem would be to compile the entire file every time the user makes an edit, but that would be extremly slow (and make your editor feel laggy). To address this problem, the language server currently extracts the expression around the cursor, puts it into a small "fake" file and tells the compiler to compile the "fake" file. Still, it would probably be better to use official compiler APIs as mentioned in the issue description.

The Kotlin demo seems to be promising in terms of performance, I will take a closer look at it soon.

from kotlin-language-server.

Strum355 avatar Strum355 commented on May 23, 2024

I don't know well enough how the current method works (lots of methods disappearing into 3rd party packages etc), but would this solve the synchronization issue where e.g. a property is referenced in one "expression" but doesnt exist yet, is added at the relevant location, yet the error that its missing still persists?

on a side note, is there a gitter or some other more convenient place where people can discuss this project with you?

from kotlin-language-server.

fwcd avatar fwcd commented on May 23, 2024

@Strum355 There is a new Gitter channel for this project:

Gitter

from kotlin-language-server.

xiaoyunwu avatar xiaoyunwu commented on May 23, 2024

@fwcd I am also interested in incremental compilation, and what is the newest pointers on this? Thanks.

from kotlin-language-server.

weilbith avatar weilbith commented on May 23, 2024

Sounds very promising to improve performance. Is it complicated to add this?

from kotlin-language-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.