Skip to content

Commit

Permalink
Add log statement
Browse files Browse the repository at this point in the history
  • Loading branch information
PMunch committed Nov 9, 2023
1 parent 58c23e1 commit 6eae464
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/nimlsppkg/suggestlib.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import std/[strformat, strutils, os]
import logger
import messageenums
import nimsuggest/nimsuggest
import compiler/ast
Expand Down Expand Up @@ -77,12 +78,16 @@ func nimSymDetails*(suggest: Suggest): string =
template createFullCommand(command: untyped) {.dirty.} =
proc command*(nimsuggest: NimSuggest, file: string, dirtyfile = "",
line: int, col: int): seq[Suggest] =
let dirtyfile = if fileExists(dirtyfile): dirtyfile else: ""
let dirtyfile = if fileExists(dirtyfile): dirtyfile else:
debugLog "Unable to find file ", dirtyfile
""
nimsuggest.runCmd(`ide command`, AbsoluteFile file, AbsoluteFile dirtyfile, line, col)

template createFileOnlyCommand(command: untyped) {.dirty.} =
proc command*(nimsuggest: NimSuggest, file: string, dirtyfile = ""): seq[Suggest] =
let dirtyfile = if fileExists(dirtyfile): dirtyfile else: ""
let dirtyfile = if fileExists(dirtyfile): dirtyfile else:
debugLog "Unable to find file ", dirtyfile
""
nimsuggest.runCmd(`ide command`, AbsoluteFile file, AbsoluteFile dirtyfile, 0, 0)

createFullCommand(sug)
Expand Down

0 comments on commit 6eae464

Please sign in to comment.