Skip to content

Commit 0b6c773

Browse files
committed
fix: sqlite always not work and another things
this is a huge pr.. before I think this project won't maintain anymore so I work myself, and follow another fork.. but that one also inactive I will pr for this This pr induced typos ci, dependabot, bump a lot of dependencies, make format, remove deperate function and etc
1 parent 18e65bc commit 0b6c773

File tree

86 files changed

+1537
-965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1537
-965
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Tracking issue
3+
about: Tracking issues are used to track progress on massive efforts (refactoring
4+
or massive new feature)
5+
title: ''
6+
labels: tracking
7+
assignees: ''
8+
9+
---
10+
11+
# State of art
12+
13+
<!--
14+
15+
Describe how things work now. How overall architecture of the current solution works. If possible, try to dig for why this solution was employed.
16+
17+
-->
18+
19+
# Why to change?
20+
21+
<!--
22+
23+
Describe, why current solution is not good enough. Discuss what drawbacks it has and how they affect KLSP.
24+
25+
-->
26+
27+
# Implementation considerations
28+
29+
<!--
30+
31+
Provide your ideas and insights on how the solution can be implemented in a better way. This includes describing new architecture, highlighting important differences from the old one. You should also mention benefits the new solution brings in.
32+
33+
-->
34+
35+
# Task
36+
37+
<!--
38+
39+
Formulate a task as clean as possible. The task should be precise and limited in scope. If issue can't be described within single task, present tasks as a list with checkboxes. Each task MAY has its own issue associated to track it separately
40+
41+
-->

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
# docs
7+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
8+
version: 2
9+
updates:
10+
- package-ecosystem: "gradle"
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"
14+
# We release on Tuesdays and open dependabot PRs will rebase after the
15+
# version bump and thus consume unnecessary workers during release, thus
16+
# let's open new ones on Wednesday
17+
day: "wednesday"
18+
ignore:
19+
- dependency-name: "*"
20+
update-types: ["version-update:semver-patch"]
21+
groups:
22+
# Only update polars as a whole as there are many subcrates that need to
23+
# be updated at once. We explicitly depend on some of them, so batch their
24+
# updates to not take up dependabot PR slots with dysfunctional PRs
25+
polars:
26+
patterns:
27+
- "polars"
28+
- "polars-*"
29+
- package-ecosystem: "github-actions"
30+
directory: "/"
31+
schedule:
32+
interval: "weekly"
33+
day: "wednesday"

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build
33
on:
44
push:
55
branches:
6-
- main
6+
- master
77
pull_request:
88
workflow_dispatch:
99

@@ -17,12 +17,14 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- name: Setup JDK
20-
uses: actions/setup-java@v3
20+
uses: actions/setup-java@v4
2121
with:
2222
distribution: 'temurin'
2323
java-version: ${{ matrix.java }}
2424
- name: Setup Gradle
25-
uses: gradle/gradle-build-action@v2
25+
uses: gradle/actions/setup-gradle@v3
26+
with:
27+
cache-disabled: ${{ contains(matrix.os, 'windows') }}
2628
- name: Build
2729
run: ./gradlew :server:build :shared:build -PjavaVersion=${{ matrix.java }}
2830
- name: Detekt

.github/workflows/typos.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
# yamllint disable rule:line-length
3+
name: check_typos
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: typos-action
19+
uses: crate-ci/typos@v1.29.4

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ build
1616
target
1717
out
1818

19-
# Kotlin
20-
.kotlin
21-
2219
# Python
2320
__pycache__
2421

@@ -32,3 +29,4 @@ node_modules
3229
!.vscode/tasks.json
3330
*.vsix
3431
kls_database.db
32+
.kotlin

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ All notable changes to the language server will be documented in this file.
33

44
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
55

6-
## [1.3.13]
7-
- Bump Kotlin to 2.1.0
8-
96
## [1.3.12]
107
- Make code generation for Java interop opt-in (#585)
118

CONTRIBUTION.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
2+
# Project workflow and Guidelines
3+
4+
## Conventional commits
5+
6+
We love and therefore use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
7+
8+
Conventional commits requires next commit types:
9+
- `feat`
10+
- `fix`
11+
12+
13+
Additionally we introduce the next ones:
14+
- `refactor` - for changes, which heavily modifies the code with the sole goal to simplify the code. The change MUST NOT introduce any new features, but MAY introduce fixes occasionally.
15+
- `chore` - for small changes, such as variable/file renaming, changes to comments, import organisation, formatting
16+
17+
## Feature based workflow
18+
19+
We use feature based workflow, which implies branch per feature/bug/issue
20+
21+
## Guidelines
22+
23+
Project has a lot of old code. It heavily relies on side-effects. Whenever working on project, try to spot usage of side effects and rewrite them with pure code.
24+
25+
## SCRUM
26+
27+
SCRUM appreciates initiative from every project participant. You can choose and create tasks for your self, define your focus as long, as this aligns with major project goals.
28+
29+
## ~~Tracking issues~~
30+
31+
> ### ⚠️Tracking issues are canceled.
32+
> We are using epics, user stories and tasks for the same purpose on our Taiga board. Please, use [this](./.github/ISSUE_TEMPLATE/tracking-issue.md) template.
33+
34+
~~If you want to introduce massive change, please create a corresponding tracking issue and pull-request.~~
35+
36+
## Project-wise requirements
37+
38+
> These requirements apply to the project as a whole.
39+
40+
KLSP:
41+
- ***MUST NOT* create any system files in user's project folder, and user's home folder.**
42+
- It clogs user's project with unnecessary information which can be stored in more appropriate place. Such files can be modified, deleted or corrupted in other way.
43+
- Consider using temp files or placing files according to XDG specs (`~/.config/<program-name>/config`)
44+
- Temporary files, such as logs and databases, are allowed to be stored in OS's temp directory.
45+
- *SHOULD NOT* rely on editor specific features
46+
- *SHOULD* have dedicated class for server configuration. sourcepath, etc.
47+
- ***SHOULD NOT* rely on command line tools even if they are a part of POSIX standard.**
48+
- Command line tools are mainly designed for humans, not programs. Their usage involves text parsing which is error prone approach. Usage of CLI tools via ProcessBuilder or any other means of process spawning is considered a crutch and should be replaced with a proper API calls.
49+
50+
51+
# Development
52+
53+
## New to Kotlin?
54+
55+
Check out these links:
56+
- [Kotlin Function features](https://kotlinlang.org/docs/functions.html)
57+
- [infix notation](https://kotlinlang.org/docs/functions.html#infix-notation)
58+
- [Kotlin lambdas](https://kotlinlang.org/docs/lambdas.html)
59+
- [Scope functions](https://kotlinlang.org/docs/scope-functions.html)
60+
61+
While working with kotlin, you are likely to encounter concepts from the above list
62+
63+
## How to Setup Custom Kotlin Language Server
64+
65+
> Custom version of [`vscode-kotlin`](#custom-vscode-kotlin) required
66+
67+
While working on this project, it may be useful to try it out right away! Luckily for us, `vscode-kotlin` extension supports custom versions for kotlin-language-server.
68+
69+
Check out [kotlin.languageServer.path](vscode://settings/kotlin.languageServer.path) in vscode settings (if link does not work, use above setting id to search for it). The setting requires a path to `kotlin-language-server` bash script. The script is auto generated by Gradle. The script is useless by itself and requires full `kotlin-language-server` installation to be present. To make such installation from sources, run:
70+
```
71+
gradlew installDist
72+
```
73+
74+
> The command generates unpacked ready to be used `kotlin-language-server` installation.
75+
76+
> Installation consists of all required dependencies, the server itself and the script
77+
78+
Set [kotlin.languageServer.path](vscode://settings/kotlin.languageServer.path) to `<workspaceRoot>/server./server/build/install/server/bin/kotlin-language-server`. Replace `<workspaceRoot>` with the actual path tp `kotlin-language-server` repository on your local filesystem.
79+
80+
## Launch Kotlin Language Server in Debug mode
81+
82+
> **⚠️ All setting mentioned in this section should be set for *WORKSPACE* profile only!**
83+
84+
![workspace-settings](./images/workspace-settings.png)
85+
86+
Kotlin language server supports debugging in next [connection modes](vscode://settings/kotlin.languageServer.transport):
87+
- `tcp-attach`
88+
- `stdio`
89+
90+
### STDIO Connection
91+
92+
In `stdio` mode `vscode-kotlin` extension completely manages server lifecycle. That is you can't manually restart on completely stop the server. To restart the server do the following: `Ctrl + Shift + P` to open vscode command prompt -> `Developer: Reload Window`. This will reload window and restart extension host, so the kotlin server would be restarted too.
93+
94+
Then activate these settings:
95+
- [kotlin.languageServer.debugAttach.enabled](vscode://settings/kotlin.languageServer.debugAttach.enabled)
96+
- [kotlin.languageServer.debugAttach.autoSuspend](vscode://settings/kotlin.languageServer.debugAttach.autoSuspend)
97+
98+
### TCP Attach
99+
100+
On the other hand, `tcp-attach` mode allows *you* to manage lifecycle of the server. `vscode-kotlin` automatically connect/reconnects to the server when server becomes available. When server is killed, extension automatically disconnects and waits for new instance of the server.
101+
102+
In this mode, you manage the server. To start it, use the next command from the root of `kotlin-language-server` workspace:
103+
104+
```
105+
./server/build/install/server/bin/kotlin-language-server --tcpClientPort 7721
106+
```
107+
108+
This launches the server in `TCP Client` mode. The server will connect to the specified `tcpClientPort`.
109+
110+
Default port is `7721`
111+
112+
#### Implementation details
113+
114+
`vscode-kotlin` launches tcp server to accept new connections. Once `vscode-languageclient` requests new connection, `vscode-kotlin` starts to listen for new connections on the [kotlin.languageServer.port](vscode://settings/kotlin.languageServer.port). When single connection is accepted, `vscode-kotlin` stops to listen for new connections. Once connections is closed and `vscode-languageclient` requests new connection, `vscode-kotlin` starts to listen for connections again.
115+
116+
## Custom `vscode-kotlin`
117+
118+
We have fork of `fwcd/vscode-kotlin` in our organisation: `Kotlin-Language-Server/vscode-kotlin`. Our fork is the *custom* version of the extension. If you are a part of the team, you can download custom builds from github.
119+
120+
1. Proceed to [Build and Publish Devs Only](https://github.com/Kotlin-Language-Server/vscode-kotlin/actions/workflows/build.yml)
121+
2. Click on the latest run
122+
3. Scroll down until **Artifacts** section appears
123+
4. Press download button on the right side of `vscode-kotlin-<short_sha>`
124+
5. Unzip the downloaded artifact
125+
6. Install `kotlin.vsix`
126+
7. Reload vscode

EDITORS.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,29 +84,6 @@ require'lspconfig'.kotlin_language_server.setup{
8484
## Monaco Editor
8585
See [kotlin-monaco-language-server](https://github.com/yahorbarkouski/kotlin-monaco-language-server).
8686

87-
## Helix
88-
89-
Using [languages.toml](https://github.com/helix-editor/helix/blob/master/book/src/languages.md)
90-
91-
```toml
92-
[language-server.kotlin-language-server]
93-
command = "kotlin-language-server"
94-
95-
[[language]]
96-
name = "kotlin"
97-
scope = "source.kotlin"
98-
file-types = ["kt", "kts"]
99-
roots = ["settings.gradle", "settings.gradle.kts"]
100-
comment-token = "//"
101-
block-comment-tokens = { start = "/*", end = "*/" }
102-
indent = { tab-width = 4, unit = " " }
103-
language-servers = [ "kotlin-language-server" ]
104-
105-
[[grammar]]
106-
name = "kotlin"
107-
source = { git = "https://github.com/fwcd/tree-sitter-kotlin", rev = "a4f71eb9b8c9b19ded3e0e9470be4b1b77c2b569" }
108-
```
109-
11087
## Other Editors
11188
Install a [Language Server Protocol client](https://microsoft.github.io/language-server-protocol/implementors/tools/) for your tool. Then invoke the language server executable in a client-specific way.
11289

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,35 @@
55
[![Downloads](https://img.shields.io/github/downloads/fwcd/kotlin-language-server/total)](https://github.com/fwcd/kotlin-language-server/releases)
66
[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da)](https://discord.gg/cNtppzN)
77

8+
## Notice and status
9+
10+
This is fork of currently almost unmaintained upstream repo: https://github.com/fwcd/kotling-language-server
11+
12+
*This fork* is being maintained in developers' spare time. Our goal is to make this extension usable and feature complete. We *do not* aim for full feature parity with JetBrains ide's Kotlin support.
13+
14+
> We do support only Linux and MacOS. Windows is not tested but still may work. Windows only issues has least priority.
15+
16+
## Kotlin Language Server
17+
818
A [language server](https://microsoft.github.io/language-server-protocol/) that provides smart code completion, diagnostics, hover, document symbols, definition lookup, method signature help and more for [Kotlin](https://kotlinlang.org).
919

1020
![Icon](Icon128.png)
1121

1222
Any editor conforming to LSP is supported, including [VSCode](https://github.com/fwcd/vscode-kotlin) and [Atom](https://github.com/fwcd/atom-ide-kotlin).
1323

24+
### Scope of the project
25+
26+
This project is strictly limited by Language Server Protocol capabilities. We aim to provide complete language server experience.
27+
28+
Some features, that our users may expect, lies outside of our responsibility. We won't deliver any features related to code and test running, project building. These tasks should be performed by other means. We offload these features to editor specific extensions.
29+
1430
## Getting Started
1531

32+
* See [CONTRIBUTION.md](CONTRIBUTION.md) for development guidelines
33+
* See [Taiga board](https://tree.taiga.io/project/owl-from-hogvarts-kotlin-language-server/timeline) for ongoing and planed work. Core team uses it as main tool for cooperation and project's status tracking
1634
* See [BUILDING.md](BUILDING.md) for build instructions
1735
* See [Editor Integration](EDITORS.md) for editor-specific instructions
1836
* See [Troubleshooting](TROUBLESHOOTING.md) for tips on troubleshooting errors
19-
* See [Roadmap](https://github.com/fwcd/kotlin-language-server/projects/1) for features, planned additions, bugfixes and changes
2037
* See [Kotlin Quick Start](https://github.com/fwcd/kotlin-quick-start) for a sample project
2138
* See [Kotlin Debug Adapter](https://github.com/fwcd/kotlin-debug-adapter) for editor-agnostic launch and debug support of Kotlin/JVM programs
2239
* See [tree-sitter-kotlin](https://github.com/fwcd/tree-sitter-kotlin) for an experimental [Tree-Sitter](https://tree-sitter.github.io/tree-sitter/) grammar
@@ -27,6 +44,8 @@ Any editor conforming to LSP is supported, including [VSCode](https://github.com
2744

2845
## This repository needs your help!
2946

47+
> See [CONTRIBUTION.md](./CONTRIBUTION.md)
48+
3049
[The original author](https://github.com/georgewfraser) created this project while he was considering using Kotlin in his work. He ended up deciding not to and is not really using Kotlin these days though this is a pretty fully-functional language server that just needs someone to use it every day for a while and iron out the last few pesky bugs.
3150

3251
There are two hard parts of implementing a language server:
@@ -114,5 +133,12 @@ The Kotlin language server supports some custom initialization options via the `
114133

115134

116135
## Authors
136+
137+
### Current maintainers team
138+
* [owl-from-hogvarts](https://github.com/owl-from-hogvarts)
139+
* [localPiper](https://github.com/localPiper)
140+
* [Zerumi](https://github.com/zerumi)
141+
142+
### Original authors
117143
* [georgewfraser](https://github.com/georgewfraser)
118144
* [fwcd](https://github.com/fwcd)

TODO.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)