Skip to content

Commit

Permalink
Fixes in parser - now you not need to open project to be correctly pa…
Browse files Browse the repository at this point in the history
…rsed when using locked file.
  • Loading branch information
engor committed Aug 1, 2018
1 parent b1b1747 commit f976dfa
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions PathsProvider.monkey2
Expand Up @@ -56,32 +56,31 @@ Class PathsProvider
Local modName:=path.Slice( i1,i2 )
' main file of a module
'
path=modsDir+modName+"/"+modName+".monkey2"
Return modsDir+modName+"/"+modName+".monkey2"
Endif
Else
' is it a project file?
' priority for locked file
'
Local lockedPath:=docsManager().LockedDocument?.Path
If lockedPath
If ExtractDir( path ).Contains( ExtractDir( lockedPath ) )
' will parse locked file coz 'path' is under 'locked' folder
Return lockedPath
Endif
Endif
' check as a part of project
'
Local proj:=ProjectView.FindProject( path )
If proj
Local showNote:=True
If proj.MainFilePath
path=proj.MainFilePath
Else
Local lockedProj:Monkey2Project
Local lockedPath:=docsManager().LockedDocument?.Path
If lockedPath And lockedPath<>path
lockedProj=ProjectView.FindProject( lockedPath )
If lockedProj And lockedProj=proj
' will parse locked file coz it's the same project as current file
path=lockedPath
showNote=False
Endif
Endif
Return proj.MainFilePath
Endif
If showNote Then ProjectView.CheckMainFilePath( proj,False )
Endif
Endif

' as is
Return path
End

Expand Down

0 comments on commit f976dfa

Please sign in to comment.