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)

F. W.
@fwcd_gitlab
Hmm, I have experienced some weird issues with generic types in hovers too
I will take a look at your PRs this weekend
Noah Santschi-Cooney
@Strum355
no worries, the two of them are still relatively WIP as in they work for certain cases but would ideally be extended for more cases sometime in the near or far future. Can merge them as they are if you wish
Noah Santschi-Cooney
@Strum355
java extension is able to give javadoc for built-in types (maybe for other types as well?) Ill look into how they get it over the next while
Noah Santschi-Cooney
@Strum355
weird error in a signature helper function, where it calculates the difference between the cursor and the start of the parameter list and uses that offset in getting a subsequence of the parameter list string. It causes a string out of bounds if the difference is larger than the length of the string, so i need to find out what the function is actually trying to do with its code
Noah Santschi-Cooney
@Strum355
been super busy with college, sorry theres been no work done
Noah Santschi-Cooney
@Strum355
semester over, back to kotlin
Tomer
@Tadaboody
:tada:
Joshua Cristol
@jcristol
hello i'm working on using Kotlin in vscode and i'm having trouble getting the extension Kotlin which uses the KotlinLanguageServer working.
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?