Modify

Opened 5 years ago

Closed 5 years ago

#3843 closed Bug (Fixed)

SciTE tool "Jump to Function Prod" unable to find function definition while execution is fine

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

In the case where local files are included with "<>", SciTE tool "Jump to Function Prod" unable to find function definition while execution is fine

Steps to reproduce:

Create 3 files.

test.au3

#include <b\a.au3>
bfunc()

b\a.au3

#include-once
#include <b.au3>

b\b.au3

#include-once

Func bfunc()
	ConsoleWrite("bfunc" & @CRLF)
EndFunc

From test.au3, try "Jump to Function Prod" on "bfunc".

The console will display "Unable to find function definition: bfunc"

From my analysis, AutoItGotoDefinition:GetIncludes is made under the assumption that local files are always included with quotes.
However, this style is not enforced by the runner.

Should this be considered as a bug?

As a workaround, I patched the file AutoIt3\SciTE\lua\AutoItGotoDefinition.lua like this

--- a\AutoIt3\SciTE\lua\AutoItGotoDefinition.lua
+++ b\AutoIt3\SciTE\lua\AutoItGotoDefinition.lua
@@ -164,6 +164,10 @@
 	for line in io.lines(file) do
 		-- Force lower case
 		local include = line:match(pattern_library)
+		if include and cpath ~= "" and self:FileExists(cpath .. include) then
+			include = cpath .. include
+			self:DebugPrint("Include3 updated: " .. cpath .. include)
+		end
 		if include and not files[include] then
 			self:DebugPrint("Include1: " .. include)
 			files[include] = { IsLibrary=true, Processed=false }

Attachments (0)

Change History (1)

comment:1 by Jos, 5 years ago

Resolution: Fixed
Status: newclosed

I have made a change to AutoItGotoDefinition.lua, now available in the Beta directory, which is a little different than your proposal, but should also solve the issue.
Thanks for the report.
Jos

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.