Skip to content

Language server JSON buildsystem doesn't add a jar file to the classpath #90

@sockeye-d

Description

@sockeye-d

I'm not sure what I'm doing wrong, but I've got this file 'coho.kt'

import dev.fishies.coho.core.*
import dev.fishies.coho.core.html.*
import dev.fishies.coho.core.markdown.*
import kotlin.io.path.*

fun generate(): RootPath = root {
    md(src("index.md"))
    path {
        ktHtml("")
    }
}

This is what it looks like in VSCodium:

Image

This is my workspace.json:

{
  "modules": [
    {
      "name": "main",
      "dependencies": [
        {
          "type": "library",
          "name": "core-jar",
          "scope": "runtime"
        }
      ],
      "contentRoots": [
        {
          "path": ".",
          "excludedPatterns": [],
          "excludedUrls": [],
          "sourceRoots": [
            {
              "path": ".",
              "type": "SOURCE"
            }
          ]
        }
      ],
      "facets": []
    }
  ],
  "libraries": [
    {
      "name": "core-jar",
      "type": null,
      "roots": [
        {
          "path": "/home/fish/IDEAProjects/coho/core/build/libs/core.jar"
        }
      ],
      "excludedRoots": []
    }
  ],
  "sdks": [],
  "kotlinSettings": []
}

This is what the file tree looks like

.
├── coho.kt
├── index.md
└── workspace.json

The language server doesn't seem to want to add the provided JAR to the classpath. I don't get any diagnostics, semantic highlighting, or go to definition for the file, and I don't get autocompletion for the imports either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions