Coder Social home page Coder Social logo

vscode-kotlin's Introduction

Kotlin Language

Syntax support for the Kotlin programming language. This extension adds basic features to help make writing Kotlin much more pleasant in VSCode

Features

  • Syntax highlighting
  • Code snippets
  • Region code folding

Installation

You can install the plugin by searching for Kotlin Language extension in the extensions market place, or by entering

ext install kotlin language

in to the command palette.

Contributing

We welcome any contributions to help make the extension better. There are several ways you can contribute.

  1. By reporting issues
  2. Making feature requests
  3. Or by contributing code

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits

vscode-kotlin's People

Contributors

francis36012 avatar jonatino avatar l7ssha avatar mathiasfrohlich avatar maximilianklein avatar nishtahir avatar shumatsu avatar tommy1199 avatar xdsoar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-kotlin's Issues

Specific kotlin codeblock breaks markdown document

First, look at the following.

スクリーンショット 2020-08-18 19 24 41

You can see that the text after the code block is affected by syntax highlighting. I found that the same thing happens when we write certain code within a code block. The easiest way to reproduce this is to write only one "{" character.

スクリーンショット 2020-08-18 19 34 06

I thought it was a bug, so I reported it. thanks.

Added error detection

Hello . Please add error detection.
Unfortunately, this plugin does not detect the error.

Add support for Kotlin-JS

Hi
I develop online apps and find VSC a great tool.
For all the client (browser) code I use Kotlin-JS but the plugin keeps complaining about unresolved references (like in e.g. import org.w3c.dom.* ) or unsupported context (like dynamic) although the compiler runs through without problems. Can you please complete these references, or give advise for configuring the plugin!?

thx

Handle speech-mark at end of raw string

I noticed that syntax highlighting breaks if you have a speech-mark at the end of your raw string. e.g.

test = """"foo""""

Any subsequent lines will be highlighted as string content.

If there's a space between the speech-mark and the closing triple-speech-marks, it works fine. e.g.

test = """"foo" """

It also works if there are two speech marks. e.g.

test = """"foo"""""

I suspect as soon as it sees the first three speech-marks at the end, it ends the string literal. The fourth speech-mark then incorrectly begins a new string literal.

print() highlighting not working

The highlighting color of the "println" function works as expected, but the color of "print" does not (it stays white, e.g.). Here's what it looks like:

Screen Shot 2019-04-03 at 11 42 34

Hover Provider to show docs

Problem

You don't see the documentation in the tooltip when hovering over a code element.

Solution

Add a hover provider that displays the information.

Or are the docs only for me not showing?

Is this plugin still maintained?

The last commit to master was in July and there are multiple PR from over 2 months ago open with no comments... So my question stands, is this plugin still maintained?
If not the repository should probably be marked as deprecated.

Add full auto completion

Hello, please add this auto-complete feature to this plugin.
Without this feature, the plugin does not work at all. Thank .

Markdown Syntax Highlighting

Hi,

Syntax highlighting in markdown is code blocks is still not working for me. It was supposed to be fixed in #11

In a markdown document if I place something like this it will not be highlighted:

val len = text?.run {
    println("get length of $this")
    length //`this` can be omitted
} ?: 0

Thanks,
Ivan

kotlin support in markdown documents is missing

I have not used this plugin before but according to this fix #6 I would expect that the following section is highlighted in the editor of an .md file:

var x=3

It doesn't nor any other text I place inside.

Support Kotlin Debugging

I'm not able to set breakpoints in Kotlin files within vs code, possibly because this extension does not yet support Kotlin debugging

The Kotlin Language Client server crashing

I get error "The Kotlin Language Client server crashed 5 times in the last 3 minutes. The server will not be restarted." after installing the extension from the Store.

From log:

[2021-08-14 10:33:07.589] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/user001/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode-remote.remote-wsl-recommender/dist/extension.js
[2021-08-14 10:33:08.026] [exthost] [error] Activating extension fwcd.kotlin failed due to an error:
[2021-08-14 10:33:08.026] [exthost] [error] Error: Connection to server got closed. Server will not be restarted.
at x.handleConnectionClosed (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:901723)
at x.handleConnectionClosed (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:961797)
at t (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:899498)
at a.invoke (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:822637)
at o.fire (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:823398)
at X (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:810282)
at a.invoke (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:822637)
at o.fire (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:823398)
at fireClose (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:831279)
at Socket. (c:\Users\user001.vscode\extensions\fwcd.kotlin-0.2.23\dist\extension.js:2:832864)
at Socket.emit (events.js:327:22)
at Pipe. (net.js:673:12)

Version: 1.59.0 (user setup)
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:13:12.822Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Windows_NT x64 10.0.19043 (Windows 10 Pro)

Processor Intel(R) Core(TM) i7-9700F CPU @ 3.00GHz 3.00 GHz
Installed RAM 32.0 GB

Windows Edition Windows 10 Pro
Version 21H1
Installed on ‎2021-‎03-‎12
OS build 19043.1165
Experience Windows Feature Experience Pack 120.2212.3740.0

Use GitHub releases for vsix

Although the vsix are currently rather light, doing this would make tags a necessity and make the download and install of these binaries more logical.

Customizable colors

Should be some way to customize the colors. Currently, the syntax highlighting is basically useless as almost everything is in the same color.

Screenshot 2020-06-22 at 13 39 08

Doesn't work in VS Code

thank you for reading this issue before, am tried to installing this extension on my VS Code. It's done properly. But, when am try to running my code. vs code said : You don't have an extension for debugging Kotlin. Should we ..... ?

what I suppose to do with that ? there is any more guide for me to solve this ?
image

Code Snippet not work

How do I make the code snippet work? I try to trigger the code snippet with ctrl + space, but nothing there.

image

Syntax highlighting problem with if expression

There seems to be a problem when highlighting this code. For some reason, after min function, the comments and the function below seem to break
image

After further testing, the issue exist in the if statement.
image
image

Support for imports

Add auto-import support the same way Java plugin provide you with hints on where you can find un-imported objects.

The Kotlin Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

I got this notification in VS code.

The Kotlin Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

And try to follow the instruction in Developer Tools I got another message.

❯ /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java -Xverify:none -jar /Users/wk/.vscode/extensions/georgewfraser.kotlin-0.1.0/target/KotlinLanguageServer.jar
Exception in thread "main" java.lang.IllegalStateException: LOGGING: Loading modules: [java.se, javafx.base, javafx.controls, javafx.fxml, javafx.graphics, javafx.media, javafx.swing, javafx.web, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.incubator.httpclient, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.cmm, jdk.management.jfr, jdk.management.resource, jdk.net, jdk.packager, jdk.packager.services, jdk.plugin.dom, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.xml.dom, oracle.desktop, oracle.net, java.base, java.sql, java.logging, java.xml, java.rmi, java.scripting, java.security.sasl, java.management, java.datatransfer, java.desktop, java.xml.crypto, java.prefs, java.instrument, java.naming, java.compiler, java.sql.rowset, java.management.rmi, java.security.jgss, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.opt, jdk.internal.le, jdk.jdeps, jdk.jlink] (no MessageCollector configured)
	at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.report(ClasspathRootsResolver.kt:314)
	at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.report$default(ClasspathRootsResolver.kt:312)
	at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.addModularRoots(ClasspathRootsResolver.kt:254)
	at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.computeRoots(ClasspathRootsResolver.kt:124)
	at org.jetbrains.kotlin.cli.jvm.compiler.ClasspathRootsResolver.convertClasspathRoots(ClasspathRootsResolver.kt:79)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:233)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:117)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:413)
	at org.javacs.kt.Compiler.<init>(Compiler.kt:46)
	at org.javacs.kt.CompilerClassPath.<init>(CompilerClassPath.kt:9)
	at org.javacs.kt.KotlinLanguageServer.<init>(KotlinLanguageServer.kt:14)
	at org.javacs.kt.MainKt.main(Main.kt:8)

Char literal syntax highlighting wrong for double-quote '"'

Issue Type: Bug

The Kotlin syntax for a double-quote char literal is '"'. Enter this by typing '"'. This syntax is highlighted incorrectly in vscode. It's highlighted as if the double-quotes somehow trump the single-quote char literals, which they should not.

Here is some Kotlin source code that illustrates the problem.

val a = '"'
val dummy1 = 1
val b = '"'
val dummy2 = 2

Here is an image showing the incorrect syntax highlighting in vscode:

incorrect syntax highlighting

Compare to an image of some correct highlighting from Android Studio:

correct syntax highlighting

Extension version: 1.7.1
VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 x 3410)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.95GB (8.58GB free)
Process Argv . --crash-reporter-id e5e654ef-9a6a-490b-ab1a-fca91fec1429
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
openlogontheside:30221877
python763:30178808
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
python504:30227505
vswsl492:30211401
wsl2prompt:30224612
pythonvsdeb440cf:30237828
unusedprompt:30224610
folderexplorercf:30224615
openfilemenu:30224647
pythonvsded773:30236629
vsjup459:30237187

Integrate idea plugin

I'm wondering how much work would require to integrate the plugin used by intellij idea community edition. It has a lot of features including static analysis, formatter, goto declaration, refactor and similar stuff. What do you think, is it doable?

Tabs for indentation

Hi,

Is there a way to get tabs (4 characters wide, not spaces) when using your extension?

That's my personal preference even if it's not Kotlin's official style.

I tried this in VS Code settings JSON file but it seemingly did nothing... Still getting 2 spaces for each Tab press.

"[kotlin]": {
	"editor.tabSize": 4,
},

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.