Merge branch 'master' of github.com:Araq/Nimrod
This commit is contained in:
commit
a294d45fd6
4 changed files with 21 additions and 8 deletions
|
|
@ -210,7 +210,11 @@ proc CommandSuggest =
|
||||||
msgs.gErrorMax = high(int) # do not stop after first error
|
msgs.gErrorMax = high(int) # do not stop after first error
|
||||||
semanticPasses()
|
semanticPasses()
|
||||||
rodPass()
|
rodPass()
|
||||||
compileProject()
|
# XXX: this handles the case when the dirty buffer is the main file,
|
||||||
|
# but doesn't handle the case when it's imported module
|
||||||
|
var projFile = if gProjectMainIdx == gDirtyOriginalIdx: gDirtyBufferIdx
|
||||||
|
else: gProjectMainIdx
|
||||||
|
compileProject(projFile)
|
||||||
|
|
||||||
proc wantMainModule =
|
proc wantMainModule =
|
||||||
if gProjectFull.len == 0:
|
if gProjectFull.len == 0:
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ type
|
||||||
TFileInfo*{.final.} = object
|
TFileInfo*{.final.} = object
|
||||||
fullPath*: string # This is a canonical full filesystem path
|
fullPath*: string # This is a canonical full filesystem path
|
||||||
projPath*: string # This is relative to the project's root
|
projPath*: string # This is relative to the project's root
|
||||||
|
shortName*: string # short name of the module
|
||||||
quotedName*: PRope # cached quoted short name for codegen
|
quotedName*: PRope # cached quoted short name for codegen
|
||||||
# purpoes
|
# purpoes
|
||||||
|
|
||||||
|
|
@ -473,7 +473,9 @@ proc newFileInfo(fullPath, projPath: string): TFileInfo =
|
||||||
#shallow(result.fullPath)
|
#shallow(result.fullPath)
|
||||||
result.projPath = projPath
|
result.projPath = projPath
|
||||||
#shallow(result.projPath)
|
#shallow(result.projPath)
|
||||||
result.quotedName = projPath.extractFilename.makeCString
|
let fileName = projPath.extractFilename
|
||||||
|
result.shortName = fileName.changeFileExt("")
|
||||||
|
result.quotedName = fileName.makeCString
|
||||||
if optEmbedOrigSrc in gGlobalOptions or true:
|
if optEmbedOrigSrc in gGlobalOptions or true:
|
||||||
result.lines = @[]
|
result.lines = @[]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,12 @@ const
|
||||||
|
|
||||||
#template sectionSuggest(): expr = "##begin\n" & getStackTrace() & "##end\n"
|
#template sectionSuggest(): expr = "##begin\n" & getStackTrace() & "##end\n"
|
||||||
|
|
||||||
|
proc origModuleName(m: PSym): string =
|
||||||
|
result = if m.position == gDirtyBufferIdx:
|
||||||
|
fileInfos[gDirtyOriginalIdx].shortName
|
||||||
|
else:
|
||||||
|
m.name.s
|
||||||
|
|
||||||
proc SymToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string =
|
proc SymToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string =
|
||||||
result = section
|
result = section
|
||||||
result.add(sep)
|
result.add(sep)
|
||||||
|
|
@ -31,9 +37,9 @@ proc SymToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string =
|
||||||
let ow = s.owner
|
let ow = s.owner
|
||||||
if ow.kind != skModule and ow.owner != nil:
|
if ow.kind != skModule and ow.owner != nil:
|
||||||
let ow2 = ow.owner
|
let ow2 = ow.owner
|
||||||
result.add(ow2.name.s)
|
result.add(ow2.origModuleName)
|
||||||
result.add('.')
|
result.add('.')
|
||||||
result.add(ow.name.s)
|
result.add(ow.origModuleName)
|
||||||
result.add('.')
|
result.add('.')
|
||||||
result.add(s.name.s)
|
result.add(s.name.s)
|
||||||
result.add(sep)
|
result.add(sep)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ completion_dot_syntax_main.nim
|
||||||
> idetools --track:$TESTNIM,24,15 --def
|
> idetools --track:$TESTNIM,24,15 --def
|
||||||
def\tskProc\t$MODULE.echoRemainingDollars
|
def\tskProc\t$MODULE.echoRemainingDollars
|
||||||
> idetools --trackDirty:completion_dot_syntax_dirty.nim,$TESTNIM,25,12 --suggest
|
> idetools --trackDirty:completion_dot_syntax_dirty.nim,$TESTNIM,25,12 --suggest
|
||||||
sug\tskProc\tcompletion_dot_syntax_dirty.echoRemainingDollars
|
sug\tskProc\techoRemainingDollars
|
||||||
# The suggestion should not mention the other echoRemaining* variants.
|
# The suggestion should not mention the other echoRemaining* variants.
|
||||||
!sug\tskProc\tcompletion_dot_syntax_dirty.echoRemainingEuros
|
!echoRemainingEuros
|
||||||
!sug\tskProc\tcompletion_dot_syntax_dirty.echoRemainingBugs
|
!echoRemainingBugs
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue