by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 22 2018 18:48

    fwcd on master

    Added Gitter (compare)

Joshua Cristol
@jcristol
I have installed a fresh version of vscode and the only extension I have installed is https://marketplace.visualstudio.com/items?itemName=fwcd.kotlin
I think the language server is launching given my vscode developer debug console but I don't really know where to go from here to understand why I am not getting code completion or syntax suggestions
Interestingly I am getting syntax highlighting could that be a sign of the language server partially working??
My spec are running Kotlin on OSX Mojave and I have kotlin installed through brew
Joshua Cristol
@jcristol
^ disregard I got everything to work by clearing out vscode's settings.json
F. W.
@fwcd_gitlab
That's great! Syntax highlighting uses a TextMate grammar file though and is not part of the language server. (neither is it supported by LSP) Since VSCode loads this grammar directly from the extension package, it will work indepedently.
Noah Santschi-Cooney
@Strum355
@fwcd_gitlab what symbols do you mean in fwcd/KotlinLanguageServer#10
Noah Santschi-Cooney
@Strum355
also
image.png
is this something youd like to have or would you prefer the original:
image.png
personally i prefer the top one as you can see the different overloads straight away at a glance without having to scroll through each to see one at a time
F. W.
@fwcd_gitlab
The top one looks good 👍 AFAIK the Java language server presents completions in a similar way

@fwcd_gitlab what symbols do you mean in fwcd/KotlinLanguageServer#10

Showing unimported items in the completion list and automatically importing them when the user selects the item. For instance, when typing File, code completion should automatically pop up and suggest java.io.File. Once the user hits return (or tab), java.io.File should be added to the imports at the beginning of the file.

Which would essentially mimic the behavior of the Java extension
F. W.
@fwcd_gitlab
As noted in the issue, I did already experiment with such a feature a while ago by querying the entire classpath (see this separate branch and fwcd/KotlinLanguageServer#10). That implementation, however, had some severe performance issues, but if you are willing to look into it, feel free 👍 This feature would make editing a lot more comfortable IMO
Noah Santschi-Cooney
@Strum355
oh i wasnt aware that feature doesnt exist already :thinking: thought it did
maybe im confusing it with it being in the java one
i can definitely have a look into that, if the only issue is performance then i should be able to help
Noah Santschi-Cooney
@Strum355
[Info  - 19:53:06] main      Connected to client
[Info  - 19:53:06] client    Adding workspace file:///home/noah/Kotlin/KotlinLanguageServer to source path
[Info  - 19:53:06] client    Adding 101 files under /home/noah/Kotlin/KotlinLanguageServer to source path
[Info  - 19:53:06] client    Searching for dependencies in workspace root /home/noah/Kotlin/KotlinLanguageServer
[Info  - 19:53:06] client    Attempting dependency resolution through CLI...
[Info  - 19:53:06] client    Creating temporary gradle file /tmp/classpath3454683406276641897.gradle
[Info  - 19:53:51] client    Successfully resolved dependencies using Gradle dependencies CLI
[Info  - 19:53:51] client    Attempting dependency resolution through CLI...
[Info  - 19:53:51] client    Creating temporary gradle file /tmp/classpath1518563813544658597.gradle
[Info  - 19:53:51] client    Found gradle at /usr/sbin/gradle
[Info  - 19:53:53] client    Successfully resolved dependencies using Gradle dependencies CLI
[Info  - 19:53:53] client    Attempting dependency resolution through CLI...
[Info  - 19:53:53] client    Creating temporary gradle file /tmp/classpath2782203026256202926.gradle
[Info  - 19:53:55] client    Successfully resolved dependencies using Gradle dependencies CLI
[Info  - 19:53:55] client    Attempting dependency resolution through CLI...
[Info  - 19:53:55] client    Creating temporary gradle file /tmp/classpath6875696104469076848.gradle
[Info  - 19:53:57] client    Successfully resolved dependencies using Gradle dependencies CLI
[Info  - 19:53:57] client    Adding 30 files to class path
the first temporary gradle file creation is really slow
why does it make multiple though?
F. W.
@fwcd_gitlab
I have noticed that too, but not got around debugging it (yet)
More verbose logging of Gradle's output might help spotting the issue
F. W.
@fwcd_gitlab
I have opened an issue for that: fwcd/KotlinLanguageServer#82
Noah Santschi-Cooney
@Strum355
nice one :ok_hand: Hows life been since? Still busy with school? :smile:
F. W.
@fwcd_gitlab
Studying comp sci and mathematics now, so yeah, pretty busy most of the time 😄
Noah Santschi-Cooney
@Strum355
Ah snap mathematics as well 🙃 tough going. Am in my 3rd year of comp sci, surprisingly busy semester. Ill be starting work placement in march so if all goes well ill have good time in the evenings to contribute more
Assuming im not dead tired 👀
Noah Santschi-Cooney
@Strum355
error TS6059: File '/home/noah/Kotlin/KotlinLanguageServer/bin/vscode-extension-src/extension.ts' is not under 'rootDir' '/home/noah/Kotlin/KotlinLanguageServer/vscode-extension-src'. 'rootDir' is expected to contain all source files.
getting these now since i freshly cloned : (
Noah Santschi-Cooney
@Strum355
not sure whats up here...cant test the extension with this. happens even on upstream/master
Noah Santschi-Cooney
@Strum355
just deleted ./out and ./bin so im good
Noah Santschi-Cooney
@Strum355
private val callPattern by lazy { Regex("(.*)\\((\\$\\d+)?\\)") } why did you make this by lazy
F. W.
@fwcd_gitlab
Mostly since Pattern.compile is an expensive operation and the language server should start up as quickly as possible, though I have not benchmarked this extensively
Regarding the compilation error, maybe the Travis-Build could automatically perform a TypeScript build in addition to the Gradle build
F. W.
@fwcd_gitlab
image.png
image.png
The ideal solution to the code completion issue (analogous to the way TypeScript handles this too) would be to provide a single completion list entry that allows the user, once inserted, to select an overload through the parameter hints (by pressing the arrow keys).
F. W.
@fwcd_gitlab
Probably not a good example, since Bufferis listed twice here (First as a global constructor and then as a module import). In general every method name should only be listed once regardless of the overloads though.
Noah Santschi-Cooney
@Strum355
I was trying to see where to do that before i did it the way that i then submitted but couldnt find the way to do it in the api
I know its a thing but maybe its not implemented in lsp4j?
F. W.
@fwcd_gitlab

AFAIK it is called "signature help" (in KotlinTextDocumentService):

    override fun signatureHelp(position: TextDocumentPositionParams): CompletableFuture<SignatureHelp?> = async.compute {
        reportTime {
            LOG.info("Signature help at {}", describePosition(position))

            val (file, cursor) = recover(position, false)
            fetchSignatureHelpAt(file, cursor) ?: noResult("No function call around ${describePosition(position)}", null)
        }
    }

...which is implemented already, but still has some issues (for example not showing the popup if the parentheses were inserted by the language server after pressing a completion item or not always finding the appropriate function signature).

Noah Santschi-Cooney
@Strum355
been doing rust recently. even kotlin has a better language server than rust :smile:
F. W.
@fwcd_gitlab
Yeah, though Rust has at least an officially maintained language server
Noah Santschi-Cooney
@Strum355
any eta on periodic full compilation
for clearing out residual errors
currently the only way is to restart vscode which gets rid of change history for ctrl+z
Noah Santschi-Cooney
@Strum355
heh i started something a couple of months ago and now that ive time to revisit, i cant remember where i was tryna go
Noah Santschi-Cooney
@Strum355
https://twitter.com/deepu105/status/1095992144152748033 this is a thing, gonna see what i can do for this lang server
Jon Carr
@joncarr
Hi, I'm writing a PR to add out-of-the-box kotlin-language-server support for emacs and lsp-mode. Everything appears to be going great but I have one warning I can't get to go away. The error is Unknown request method: workspace/configuration. So my question is, where might I find the details for this request method inside the kotlin-language-server code so I can write a handler to satisfy it's requirements???