Skip to content

Commit

Permalink
Allow numbers in nimble tasks detection (#277)
Browse files Browse the repository at this point in the history
* Allow numbers in nimble tasks detection

* Adds missing file
  • Loading branch information
jmgomez authored Jan 8, 2025
1 parent f5c145a commit d30f451
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/projects/tasks/tasks.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ task helloWorld, "hello world":
echo "hello world"

task anotherTask, "Another task":
echo "another task"
echo "another task"

task anotherTask2, "Another task 2":
echo "another task 2"
2 changes: 1 addition & 1 deletion tests/textensions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ suite "Nimlangserver":
seq[NimbleTask]
)

check tasks.len == 2
check tasks.len == 3
check tasks[0].name == "helloWorld"
check tasks[0].description == "hello world"
2 changes: 1 addition & 1 deletion utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ proc getNextFreePort*(): Port =
func isWord*(str: string): bool =
var str = str.toLower()
for c in str:
if c.int notin 97 .. 122:
if c.int notin {48..57, 97..122}: # Allow 0-9 and a-z
return false
return true

Expand Down

0 comments on commit d30f451

Please sign in to comment.