Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase the plugin on grok #5

Merged
merged 12 commits into from
Aug 7, 2023
Merged

Rebase the plugin on grok #5

merged 12 commits into from
Aug 7, 2023

Conversation

splitbrain
Copy link
Collaborator

This makes the plugin use Grok and codesearch.dokuwiki.org instead on relying on the no longer maintained phpxref.

I think it should work relatively well as a drop in replacement.

@Klap-in would be great if you could have a quick look before I merge this and bring it online.

related to #2 #3 and #4

This implements a mechanism that transforms our current references into
search terms understood by Grok. Using the API we can even check if
there's any hits (ideally it should be exactly one)
Copy link
Contributor

@Klap-in Klap-in left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try it later here some first notes.

syntax.php Outdated Show resolved Hide resolved
Heuristics.php Show resolved Hide resolved
Grok.php Show resolved Hide resolved
syntax.php Show resolved Hide resolved
@Klap-in
Copy link
Contributor

Klap-in commented Feb 13, 2022

In general it works. Of course, Gork works a bit different, so different usage choices are needed.

Not found:

  * A variable: [[xref>$USERINFO]] -- not found
  *  [[xref>DokuWiki_Auth_Plugin]] -- here the class name is use put in the path, for the new class names
      that is right. Of course this is then an exception.. 
  * [[xref>$_filename]] -- not found, unclear why not... because it is not defined..? 
      (maybe because $this->_fileName= is not recognized as definition by Grok?)
  * [[xref>$replacements]] -- is ok, definition is found. Wondering if 'Symbols' would be not more 
      useful for variables..

General point for discussion:
xref points to the definition (where the variable/function/etc is defined), not to the symbols (where it is used).
Is this desired?

  • In a lot of cases I'm interested in how it is used, not in when it is defined..
  • The previous xref interface listed both definition and usage, in two separate lists, on one page. But I do not see how to get this functionality back by using the Gork functionality.
  • However, if a term is unique, it will directly open the code of the function/variable/etc. Clicking on the function, will do a symbol search (=usage search).
  • [[codesearch>...]] does already a 'Full' search.

@Klap-in
Copy link
Contributor

Klap-in commented Feb 13, 2022

I'm a bit puzzeling, if there is an simple syntax to:

Copy link
Contributor

@Klap-in Klap-in left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I check this another time. I think it can work well.

Remaining case which I cannot explain is [[xref>$USERINFO]]. Therfore, no suggestions for improvement.

[[xref>$_filename]] was not working due to case-sensitivity, must be [[xref>$_fileName]].
[[xref>DokuWiki_Auth_Plugin]] is also not working, but that is because it is an alias. Therefore, it is logic OpenGrok is not recognizing it. That can be workaround with [[codesearch>DokuWiki_Auth_Plugin]].

I did a proposal for supporting arguments in the brackets of functions.

Further fine for me to merge and publish :-)

lang/en/lang.php Outdated Show resolved Hide resolved
lang/en/lang.php Outdated Show resolved Hide resolved
lang/en/lang.php Outdated Show resolved Hide resolved
_test/HeuristicsTest.php Show resolved Hide resolved
Heuristics.php Show resolved Hide resolved
Heuristics.php Show resolved Hide resolved
syntax.php Show resolved Hide resolved
splitbrain and others added 6 commits August 7, 2023 17:44
Co-authored-by: Gerrit Uitslag <[email protected]>
Co-authored-by: Gerrit Uitslag <[email protected]>
Co-authored-by: Gerrit Uitslag <[email protected]>
Co-authored-by: Gerrit Uitslag <[email protected]>
Co-authored-by: Gerrit Uitslag <[email protected]>
@splitbrain splitbrain merged commit 6f047e8 into master Aug 7, 2023
8 checks passed
@splitbrain splitbrain deleted the codesearch branch August 7, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants