Skip to content

Commit 4adddf8

Browse files
authored
Bumps version 1.4.0 (#131)
1 parent e5078fc commit 4adddf8

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# ChangeLog
2+
## 1.4.0 (14 Jan 2025)
3+
* Adds support for `nimble` files.
4+
* Adds `nimble tasks` to the status panel.
5+
* nimble tasks can be ran from the nimble file.
6+
* Automatically calls `nimble setup` when a nimble project is detected.
7+
* Replaces the bell icon with a blue underline for propagated exceptions.
8+
* From the lsp:
9+
- Macro expansion on hover.
10+
- ARC expansion on hover.
11+
- `nim check` is the default backend for linting (use `"nim.useNimCheck": false` to revert to `nimsuggest chk`).
212

313
## 1.2.0 (23 Sep 2024)
414
* Restart nimsuggest per file basis from the status panel.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,10 @@
293293
},
294294
"nim.lintOnSave": {
295295
"type": "boolean",
296-
"default": true,
296+
"default": false,
297297
"description": "Check code by using 'nim check' on save.",
298-
"scope": "resource"
298+
"scope": "resource",
299+
"deprecationMessage": "Deprecated: Please use the Nim language server backend instead."
299300
},
300301
"nim.enableNimsuggest": {
301302
"type": "boolean",
@@ -320,7 +321,8 @@
320321
"type": "boolean",
321322
"default": false,
322323
"description": "Use nimsuggest in order to run check, instead of the nim compiler.",
323-
"scope": "resource"
324+
"scope": "resource",
325+
"deprecationMessage": "Deprecated: Please use the Nim language server backend instead."
324326
},
325327
"nim.logNimsuggest": {
326328
"type": "boolean",

src/nimcodelenses.nim

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import std/[jsconsole, strformat, strutils, options, sequtils]
2+
import platform/[vscodeApi, languageClientApi]
3+
import spec, nimUtils
4+
# TODO gutter icons doesnt support click https://github.com/microsoft/vscode/issues/224134
5+
# Review at some point and use that instead of codelenses.
6+
7+
proc parseIconPath(vscode: Vscode, iconPath: cstring): VscodeUri {.importjs: "#.Uri.parse(#)".}
8+
9+
proc lineAsTask(state: ExtensionState, lineText: string): Option[cstring] =
10+
result = none(cstring)
11+
try:
12+
let taskName = lineText.split(" ")[1].split(",")[0].cstring
13+
if taskName in state.nimbleTasks.mapIt(it.name):
14+
return some(taskName)
15+
except: discard
16+
17+
proc provideNimbleTasksCodeLenses*(document: VscodeTextDocument, token: VscodeCancellationToken): seq[VscodeCodeLens] =
18+
result = @[]
19+
if not ($document.fileName).endsWith(".nimble"):
20+
return
21+
let state = ext
22+
var line = 0
23+
let text = $document.getText()
24+
#TODO parse this properly
25+
for lineText in text.split("\n"):
26+
let taskName = lineAsTask(state, lineText)
27+
if taskName.isSome:
28+
let range = vscode.newRange(line, 0, line, 0)
29+
let command = VscodeCommands()
30+
command.command = "nim.onNimbleTask"
31+
command.title = "$(play-circle) Run task"
32+
command.arguments = @[taskName.get.toJs()]
33+
result.add(vscode.newCodeLens(range, command))
34+
inc line

0 commit comments

Comments
 (0)