Skip to content

JSON Parse error: Unterminated string with openrouter/kimi-k2 #1278

Closed

Description

@esafak
ls.initializeParams.getRootPath\n    pathRelativeToRoot =
fileUri.tryRelativeTo(rootPath)\n    mappings =
ls.getWorkspaceConfiguration.await().projectMapping.get(@[])\n\n  if
pathRelativeToRoot.isSome:\n    for mapping in mappings:\n      var m: RegexMatch2\n
if find(pathRelativeToRoot.get(), re2(mapping.fileRegex), m):\n        ls.showMessage(\n
fmt\"RegEx matched `{mapping.fileRegex}` for file `{fileUri}`\", MessageType.Info\n
)\n        result = string(rootPath) / mapping.projectFile\n        if
fileExists(result):\n          trace \"getProjectFile?\",\n            project = result,
uri = fileUri, matchedRegex = mapping.fileRegex\n          return result\n      else:\n
trace \"getProjectFile does not match\",\n          uri = fileUri, matchedRegex =
mapping.fileRegex\n\n  #If we reached the maximum instances of nimsuggest, we just return
the first project\n  let shouldSpawn = await ls.shouldSpawnNimsuggest()\n  if not
shouldSpawn:\n    result = ls.projectFiles.keys.toSeq[0]\n    debug \"Reached the maximum
instances of nimsuggest, reusing the first nimsuggest instance\", project = result\n
return result\n\n  result = await ls.getProjectFileAutoGuess(fileUri)\n  if result in
ls.projectFiles:\n    let ns = await ls.projectFiles[result].ns\n    let isKnown = await
ns.isKnown(fileUri)\n    if ns.canHandleUnknown and not isKnown:\n      debug \"File is
not known by nimsuggest\", uri = fileUri, projectFile = result\n      result =
fileUri\n\n  debug \"getProjectFile \", project = result, fileUri = fileUri",
"newString": "proc getProjectFile*(fileUri: string, ls: LanguageServer): Future[string]
{.async.} =\n  let\n    rootPath = ls.initializeParams.getRootPath\n
pathRelativeToRoot = fileUri.tryRelativeTo(rootPath)\n    mappings =
ls.getWorkspaceConfiguration.await().projectMapping.get(@[])\n\n  # First, check
projectMapping for exact matches\n  for mapping in mappings:\n    var m: RegexMatch2\n
let filePath = fileUri.uriToPath\n    \n    # Check if file matches the regex pattern.
Error message: JSON Parse error: Unterminated string

Activity

  1. self-assigned this
    on Jul 25, 2025
  2. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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