Skip to content

Commit

Permalink
Improved: IntelliSense
Browse files Browse the repository at this point in the history
  • Loading branch information
XusinboyBekchanov committed Mar 5, 2023
1 parent 3da39ad commit 97ace15
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 34 deletions.
8 changes: 4 additions & 4 deletions VisualFBEditor.vfp
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ File=VisualFBEditor64.desktop
File=VisualFBEditor_Change.log
ProjectType=0
Subsystem=2
ProjectName="Visual FB Editor"
ProjectName="VisualFBEditor"
HelpFileName=" "
ProjectDescription="Visual FB Editor"
PassAllModuleFilesToCompiler=false
OpenProjectAsFolder=false
MajorVersion=1
MinorVersion=3
RevisionVersion=4
BuildVersion=523
BuildVersion=1934
AutoIncrementVersion=false
ApplicationTitle="Visual FB Editor"
ApplicationIcon="1"
Expand All @@ -94,9 +94,9 @@ OptimizationLevel=0
OptimizationFastCode=false
OptimizationSmallCode=false
CompilationArguments32Windows="-x "../VisualFBEditor32.exe""
CompilationArguments64Windows="-x "../VisualFBEditor64.exe" -gen gas64"
CompilationArguments64Windows="-x "../VisualFBEditor64.exe""
CompilationArguments32Linux="-x "../VisualFBEditor32_gtk3" -d __USE_GTK3__"
CompilationArguments64Linux="-x "../VisualFBEditor64_gtk3" -d __USE_GTK3__"
CompilationArguments64Linux="-x "../VisualFBEditor64_gtk2" -d __USE_GTK2__ -gen gas64"
CompilerPath=""
CommandLineArguments=" "
CreateDebugInfo=false
Expand Down
3 changes: 2 additions & 1 deletion src/Main.bas
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Dim Shared As TrackBar trLeft
Dim Shared As MainMenu mnuMain
Dim Shared As MenuItem Ptr mnuStartWithCompile, mnuStart, mnuBreak, mnuEnd, mnuRestart, mnuStandardToolBar, mnuEditToolBar, mnuProjectToolBar, mnuBuildToolBar, mnuRunToolBar, mnuSplit, mnuSplitHorizontally, mnuSplitVertically, mnuWindowSeparator, miRecentProjects, miRecentFiles, miRecentFolders, miRecentSessions, miSetAsMain, miTabSetAsMain, miTabReloadHistoryCode, miRemoveFiles, miToolBars
Dim Shared As MenuItem Ptr miSaveProject, miSaveProjectAs, miCloseProject, miCloseFolder, miSave, miSaveAs, miSaveAll, miClose, miCloseAll, miCloseSession, miPrint, miPrintPreview, miPageSetup, miOpenProjectFolder, miProjectProperties, miExplorerOpenProjectFolder, miExplorerProjectProperties, miExplorerCloseProject, miRemoveFileFromProject
Dim Shared As MenuItem Ptr miUndo, miRedo, miCutCurrentLine, miCut, miCopy, miPaste, miSingleComment, miBlockComment, miUncommentBlock, miDuplicate, miSelectAll, miIndent, miOutdent, miFormat, miUnformat, miFormatProject, miUnformatProject, miAddSpaces, miCompleteWord, miParameterInfo, miStepInto, miStepOver, miStepOut, miRunToCursor, miGDBCommand, miAddWatch, miToggleBreakpoint, miClearAllBreakpoints, miSetNextStatement, miShowNextStatement
Dim Shared As MenuItem Ptr miUndo, miRedo, miCutCurrentLine, miCut, miCopy, miPaste, miSingleComment, miBlockComment, miUncommentBlock, miDuplicate, miSelectAll, miIndent, miOutdent, miFormat, miUnformat, miFormatProject, miUnformatProject, miAddSpaces, miSuggestions, miCompleteWord, miParameterInfo, miStepInto, miStepOver, miStepOut, miRunToCursor, miGDBCommand, miAddWatch, miToggleBreakpoint, miClearAllBreakpoints, miSetNextStatement, miShowNextStatement
Dim Shared As MenuItem Ptr miNumbering, miMacroNumbering, miRemoveNumbering, miProcedureNumbering, miProcedureMacroNumbering, miRemoveProcedureNumbering, miProjectMacroNumbering, miProjectMacroNumberingStartsOfProcedures, miRemoveProjectNumbering, miPreprocessorNumbering, miRemovePreprocessorNumbering, miProjectPreprocessorNumbering, miRemoveProjectPreprocessorNumbering, miOnErrorResumeNext, miOnErrorGoto, miOnErrorGotoResumeNext, miOnLocalErrorGoto, miOnLocalErrorGotoResumeNext, miRemoveErrorHandling
Dim Shared As MenuItem Ptr dmiNumbering, dmiMacroNumbering, dmiRemoveNumbering, dmiProcedureNumbering, dmiProcedureMacroNumbering, dmiRemoveProcedureNumbering, dmiProjectMacroNumbering, dmiProjectMacroNumberingStartsOfProcedures, dmiRemoveProjectNumbering, dmiPreprocessorNumbering, dmiRemovePreprocessorNumbering, dmiProjectPreprocessorNumbering, dmiRemoveProjectPreprocessorNumbering, dmiOnErrorResumeNext, dmiOnErrorGoto, dmiOnErrorGotoResumeNext, dmiOnLocalErrorGoto, dmiOnLocalErrorGotoResumeNext, dmiRemoveErrorHandling, dmiMake, dmiMakeClean
Dim Shared As MenuItem Ptr miCode, miForm, miCodeAndForm, miCollapseCurrent, miCollapseAllProcedures, miCollapseAll, miUnCollapseCurrent, miUnCollapseAllProcedures, miUnCollapseAll, miImageManager, miAddProcedure, miFind, miReplace, miFindNext, miFindPrevious, miGoto, miDefine, miToggleBookmark, miNextBookmark, miPreviousBookmark, miClearAllBookmarks, miSyntaxCheck, miCompile, miCompileAll, miBuildBundle, miBuildAPK, miGenerateSignedBundle, miGenerateSignedAPK, miMake, miMakeClean
Expand Down Expand Up @@ -5645,6 +5645,7 @@ Sub CreateMenusAndToolBars
miUnformatProject = miEdit->Add(ML("&Unformat Project") & HK("UnformatProject"), "", "UnformatProject", @mClick, , , False)
miAddSpaces = miEdit->Add(ML("Add &Spaces") & HK("AddSpaces"), "", "AddSpaces", @mClick, , , False)
miEdit->Add("-")
miSuggestions = miEdit->Add(ML("Suggestions") & HK("Suggestions"), "Suggestions", "Suggestions", @mClick, , , False)
miCompleteWord = miEdit->Add(ML("Complete Word") & HK("CompleteWord", "Ctrl+Space"), "CompleteWord", "CompleteWord", @mClick, , , False)
miParameterInfo = miEdit->Add(ML("Parameter Info") & HK("ParameterInfo", "Ctrl+J"), "ParameterInfo", "ParameterInfo", @mClick, , , False)
miEdit->Add("-")
Expand Down
79 changes: 53 additions & 26 deletions src/TabWindow.bas
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ Sub ChangeMenuItemsEnabled
miSyntaxCheck->Enabled = bEnabled
tbtSyntaxCheck->Enabled = bEnabled
tbtSuggestions->Enabled = bEnabled
miSuggestions->Enabled = bEnabled
miCompile->Enabled = bEnabled
tbtCompile->Enabled = bEnabled
miCompileAll->Enabled = bEnabled
Expand Down Expand Up @@ -6392,6 +6393,7 @@ Sub AnalyzeTab(Param As Any Ptr)
If (Not CStyle) AndAlso CBool(Matn <> "_") AndAlso CBool(OldMatnLCase <> "defined") AndAlso CBool(OldMatnLCase <> "ifdef") AndAlso CBool(OldMatnLCase <> "ifndef") AndAlso CBool(r <> Asc("&")) AndAlso (Not StartsWith(Trim(LCase(*s), Any !"\t "), "#define")) AndAlso (Not StartsWith(Trim(LCase(*s), Any !"\t "), "#undef")) Then
If GetQuitThread(Project, tb) Then SetLastThread Project, tb, 0: Exit Sub
MutexLock tlockSuggestions
ThreadsEnter
Dim As Integer ii = 0, AddIndex = -1
Dim As UString ErrorText = ML("Error: Identifier not declared") & ", " & Matn & ". " & ML("Declare it")
Dim As UString FileName_ = ecc->FileName
Expand Down Expand Up @@ -6441,6 +6443,7 @@ Sub AnalyzeTab(Param As Any Ptr)
' tpSuggestions->Caption = ML("Suggestions") & IIf(lvSuggestions.ListItems.Count, " (" & lvSuggestions.ListItems.Count & " " & ML("Pos") & ")", "")
'End If
End If
ThreadsLeave
MutexUnlock tlockSuggestions
End If
End If
Expand Down Expand Up @@ -6548,6 +6551,7 @@ Sub AnalyzeTab(Param As Any Ptr)
Next
Next kk
MutexLock tlockSuggestions
ThreadsEnter
For i As Integer = 0 To NotUsedIdentifiers.Count - 1
te = NotUsedIdentifiers.Item(i)
If CBool(LCase(te->ElementType) = "constructor") OrElse CBool(LCase(te->ElementType) = "destructor") OrElse te->TypeProcedure Then Continue For
Expand Down Expand Up @@ -6619,6 +6623,7 @@ Sub AnalyzeTab(Param As Any Ptr)
If tpSuggestions->Caption <> ML("Suggestions") & IIf(lvSuggestions.ListItems.Count, " (" & lvSuggestions.ListItems.Count & " " & ML("Pos") & ")", "") Then
tpSuggestions->Caption = ML("Suggestions") & IIf(lvSuggestions.ListItems.Count, " (" & lvSuggestions.ListItems.Count & " " & ML("Pos") & ")", "")
End If
ThreadsLeave
MutexUnlock tlockSuggestions
SetLastThread Project, tb, 0
End Sub
Expand Down Expand Up @@ -7406,12 +7411,24 @@ Sub LoadFunctionsWithContent(ByRef FileName As WString, ByRef Project As Project
te->FileName = sFileName
te->Tag = tb
'Content.FunctionsOthers.Add te->DisplayName, te
Content.Procedures.Add te->Name, te
Content.Defines.Add te->Name, te
Project->Globals.Functions.Add te->Name, te
If Namespaces.Count > 0 Then
Var Index = Content.Namespaces.IndexOf(Cast(TypeElement Ptr, Namespaces.Object(Namespaces.Count - 1))->Name)
If Index > -1 Then Cast(TypeElement Ptr, Content.Namespaces.Object(Index))->Elements.Add te->Name, te
If inFunc AndAlso CBool(func <> 0) Then
If block AndAlso block->ConstructionIndex <> C_Enum AndAlso block->ConstructionIndex <> C_Type AndAlso block->ConstructionIndex <> C_Union AndAlso block->ConstructionIndex <> C_Class Then
block->Elements.Add te->Name, te
Else
func->Elements.Add te->Name, te
End If
Else
If block Then
block->Elements.Add te->Name, te
Else
Content.Procedures.Add te->Name, te
Project->Globals.Functions.Add te->Name, te
If Namespaces.Count > 0 Then
Var Index = Content.Namespaces.IndexOf(Cast(TypeElement Ptr, Namespaces.Object(Namespaces.Count - 1))->Name)
If Index > -1 Then Cast(TypeElement Ptr, Content.Namespaces.Object(Index))->Elements.Add te->Name, te
End If
End If
End If
Pos2 = InStr(b2, ")")
If Pos2 > 0 AndAlso Pos5 > 0 Then
Expand Down Expand Up @@ -8329,25 +8346,23 @@ Sub TabWindow.FormDesign(NotForms As Boolean = False)
End If
End If
If StartsWith(bTrimLCase, "#include ") Then
#ifndef __USE_GTK__
Pos1 = InStr(b, """")
If Pos1 > 0 Then
Pos2 = InStr(Pos1 + 1, b, """")
WLetEx FPath, GetRelativePath(Mid(b, Pos1 + 1, Pos2 - Pos1 - 1), FileName), True
If ptxtCode = @txtCode Then
If IncludesChanged Then
txtCode.Content.Includes.Add *FPath
txtCode.Content.IncludeLines.Add j
Includes.Add *FPath
End If
OldIncludeLine = j
End If
If Not pLoadPaths->Contains(*FPath) Then
Var AddedIndex = pLoadPaths->Add(*FPath)
ThreadCounter(ThreadCreate_(@LoadFunctionsSub, @pLoadPaths->Item(AddedIndex)))
Pos1 = InStr(b, """")
If Pos1 > 0 Then
Pos2 = InStr(Pos1 + 1, b, """")
WLetEx FPath, GetRelativePath(Mid(b, Pos1 + 1, Pos2 - Pos1 - 1), FileName), True
If ptxtCode = @txtCode Then
If IncludesChanged Then
txtCode.Content.Includes.Add *FPath
txtCode.Content.IncludeLines.Add j
Includes.Add *FPath
End If
OldIncludeLine = j
End If
#endif
If Not pLoadPaths->Contains(*FPath) Then
Var AddedIndex = pLoadPaths->Add(*FPath)
ThreadCounter(ThreadCreate_(@LoadFunctionsSub, @pLoadPaths->Item(AddedIndex)))
End If
End If
Else
If (ECLine->ConstructionIndex >= 0) AndAlso (ECLine->ConstructionIndex <> C_P_If) AndAlso (ECLine->ConstructionIndex <> C_P_Region) Then
If ECLine->ConstructionPart > 0 Then
Expand Down Expand Up @@ -8625,11 +8640,23 @@ Sub TabWindow.FormDesign(NotForms As Boolean = False)
te->FileName = sFileName
te->Tag = tb
'txtCode.Content.FunctionsOthers.Add te->DisplayName, te
txtCode.Content.Procedures.Add te->Name, te
txtCode.Content.Defines.Add te->Name, te
If Namespaces.Count > 0 Then
Var Index = txtCode.Content.Namespaces.IndexOf(Cast(TypeElement Ptr, Namespaces.Object(Namespaces.Count - 1))->Name)
If Index > -1 Then Cast(TypeElement Ptr, txtCode.Content.Namespaces.Object(Index))->Elements.Add te->Name, te
If inFunc AndAlso CBool(func <> 0) Then
If block AndAlso block->ConstructionIndex <> C_Enum AndAlso block->ConstructionIndex <> C_Type AndAlso block->ConstructionIndex <> C_Union AndAlso block->ConstructionIndex <> C_Class Then
block->Elements.Add te->Name, te
Else
func->Elements.Add te->Name, te
End If
Else
If block Then
block->Elements.Add te->Name, te
Else
txtCode.Content.Procedures.Add te->Name, te
If Namespaces.Count > 0 Then
Var Index = txtCode.Content.Namespaces.IndexOf(Cast(TypeElement Ptr, Namespaces.Object(Namespaces.Count - 1))->Name)
If Index > -1 Then Cast(TypeElement Ptr, txtCode.Content.Namespaces.Object(Index))->Elements.Add te->Name, te
End If
End If
End If
Pos2 = InStr(b2, ")")
If Pos2 > 0 AndAlso Pos5 > 0 Then
Expand Down
4 changes: 2 additions & 2 deletions src/frmProjectProperties.frm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ pfProjectProperties = @fProjectProperties
#ifdef __USE_GTK__
This.Icon.LoadFromFile(ExePath & "/Resources/VisualFBEditor.ico")
#else
This.Designer = @This
This.OnCreate = @_Form_Create
This.Icon.LoadFromResourceID(1)
#endif
This.Designer = @This
This.OnCreate = @_Form_Create
' tpGeneral
tpGeneral.Name = "tpGeneral"
tpGeneral.Text = ML("General")
Expand Down
2 changes: 1 addition & 1 deletion src/frmSplash.frm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Using My.Sys.Forms
'lblIcon.Graphic.Icon = 100
' lblInfo
lblInfo.Name = "lblInfo"
lblInfo.Text = "2018-2022"
lblInfo.Text = "2018-2023"
lblInfo.SetBounds 18, 332, 52, 17
lblInfo.BackColor = 0
lblInfo.Font.Color = 16777215
Expand Down

0 comments on commit 97ace15

Please sign in to comment.